XCAS
Free computer algebra software

Xcas, the Swiss army knife of mathematics

🛈 Last update May 2022, stable version 1.9.0-7.

Giac/Xcas is a free computer algebra system for Windows, Mac OSX and Linux/Unix (GPL3 license, possibility of obtaining a license for inclusion in commercial software by contacting us).

❖ Install ❖ XcasJS ❖ Access Xcas on Blackboard

Xcas in a nutshell

Features

-Computer algebra : arithmetic, integration, derivation, limits, ...
-Graphs : functions, parametric, in the plane and in space
-Spreadsheet and statistics : approximate and exact calculation
-Interactive geometry : in the plane and in space
-Programming : language in French or syntax compatible with Python (versions >=1.4.9)
-Tortue logo
-Online help : documentation entirely in French, index of functions, syntax, examples, search by keyword, completion.
-Equation editor : 2-d display of expressions, possibility to work on sub-expressions.
-Physical units : usual operations and conversion

--See also the presentation of the Trophées du Libre 2007: long version,short version or the Xcas session

Computer algebra:

Calculation with arbitrary precision (integers and floats), arithmetic of integers and polynomials (PGCD, Bézout, factorization, ...), simplification (rational fractions, trigonometric functions, ...), resolution of equations, derivation, integration ( rational fraction, heuristic methods, Risch's algorithm for transcendental functions), decomposition into simple elements of rational fractions, limits, Taylor expansion and asymptotics, linear algebra (vectors, matrices, Gaussian reduction, vectors and exact and approximate eigenvalues) ...

2-d geometry / 3-d geometry and graphs:

Points, segments, straight lines, planes, triangles, quadrilaterals, polygons, circles, conics, parametric and polar curves, intersections, tangents, parameters, angles, affixes, ... Interactive geometry All drawing instructions are programmable. The calculations can be made in an exact way using the computer algebra system, which makes it possible to make proofs (of analytical geometry).

Spreadsheet:

Absolute and relative references, exact or approximate calculation (cells can be arbitrary precision integers, variable names, expressions, ...), full access to programming functions, interface for 1-d and 2- statistics d (mean, standard deviation, histogram, covariance, correlation...)

Programming:

functions, local variables, tests, loops. Choice of syntax (in French, Python, Maple, MuPAD or TI89 compatible). Possibility in favorable cases to read and execute Python, Maple, MuPAD or TI89 programs. Integrated editor for small programs. Interactive debugger.

Multiple features used simultaneously.

Giac

Giac in Javascript:

There are several interfaces using Giac compiled in Javascript:
Xcas for Firefox Xcas Blackboard Simple Xcas calculator

To use Giac in your own Javascript projects, you can retrieve the file giacjs.tar.gz or use the command:
npm install "https://www-fourier.univ-grenoble-alpes.fr/~parisse/giacjs.tar.gz"

giacpy : Computer algebra in python:

Frédéric Han has developed a Python interface for giac, giacpy for Windows, Mac OS and Linux. It provides access to all the features and performance of Giac/Xcas from the Python(version 2.7, 3.2 or 3.3): an essential complement for students in preparatory classes who want to do computer algebra using the program language.
  • Windows installation: install Python then open "Command Prompt" from the Accessories menu. Input the commands
    python.exe -mpip install --upgrade pip
    python.exe -mpip install wheel
    python.exe -mpip install giacpy

  • Mac installation: install Xcas for Mac or seeF. Han's site
  • Linux debian compatible installation:
    sudo apt-get install python-giacpy OR sudo apt-get install python3-giacpy.
Example of commands: launch the python interpreter then input:

from giacpy import *
ifactor(2**128+1)
x=giac('x')
f=factor(x**10-1)
d=plot(sin(x))
d.qcas()
help("giacpy")
normal.help()

Example Python program using giac and giacpy: ocapy by Didier Gosseau, an RPN calculator.

Giac in console mode:

The Linux, Mac and Windows versions of Xcas contain a text version giac, usable directly or in a texmacs session (which can be tested without installing withlivetexmacs), or in an emacs session in mupad mode (read the mupacs instructions, use giac --emacs as the program to launch instead of mupad -E/-R ... ).
Alternative for emacs mode: download mupacs.tgz unarchive it from cd / ; tar xvfz chemin_vers/mupacs.tgz add (load "/usr/local/share/emacs/site-lisp/mupacs.el") in ~/.emacs , then Escape-x mupad-run and replace mupad -E/-R ... with giac --emacs .

HP Premium:

Giac is the native computer algebra engine of the HP Prime calculator as well as applications emulating the calculator on tablets, smartphones, etc. Documentation du CAS written by Renée De Graeve.

Giac and LaTeX:

There are several methods to call giac automatically from a LaTeX document and delegate certain calculations to it.
  • Compiling LaTeX to computer algebra enabled HTML5 Cexplains how we can add Xcas commands to a LaTeX document to compile it in HTML+MathML with a good rendering of the mathematical formulas and the possibility for the reader to modify and execute the commands from his browser. You can also obtain a PDF file with the calculations (and graphs) made during compilation.
  • Under linux, the program giac (ou icas) can "filter" latex files to generate HTML5 code and PDF with calculations and graphics made by the computer algebra engine of giac (this is inspired by pgiac by Jean-Michel Sarlat described below). You must have hevea and pdflatex installed. Then just type in a terminal
    giac nom_fichier
    instead of pdflatex nom_fichier (put the .tex extension in case of file name conflict). giac filters the calculations, performs them, creates EPS of the 2d graphics, then giac calls hevea -fix to generate HTML5 (to be consulted from Firefox for optimal performance) and pdflatex to generate the PDF.
    The calculations are placed in a normal .tex file where we put (just after \begin{document}) \begin{giacjsonline} and (juste avant \end{document}) \end{giacjsonline}. To make a calculation or a graph, we use a command like \giacinputbigmath{factor(x^4-1)}or \giacinput{plot(sin(x))}. The reader can modify and/or execute the order in their compatible browser (Firefox recommended). See the file testfr.tex for typical examples of commands or methnum.tex for full-scale use.
  • professor.sty is a collection of style files for automatically creating variation charts, statistics, etc. in your LaTeX documents. By Denis Le Fur and Guillaume Connan (contains Guillaume Connan's famous tablor.sty ). Usable from texmacs via professor and tablorplugins by E. Corcelle.
  • JM Sarlat's Perl pgiac script allows you to create .w sources containing giaccommand (lines starting with .g and sections starting with .g: and ending with .end), transformed after calculation into .tex files by the command pgiac nom_fichier.w. All you have to do is compile it with your preferred LaTeX distribution, cf. website Syracuse.
  • see also examples of LaTeX source using giac for calculations by G. Connan, Yves Delhaye (cf. also his query generator), and Alexandre Boisseau

French xcas documentation

About xcas

Web pages talking about Xcas:

Quotes:

If you wish to cite Giac/Xcas, you can refer to it as follows Giac/Xcas, Bernard Parisse and Renée De Graeve, version 1.2.3 (2017), http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac_fr.html

Books and manuals talking about Xcas:

Programs using Xcas:

Geogebra:in the CAS view
Facilimaths:Online exercises (high school level), also offers a PHP extension for Giac. By Jean-Pierre Branchard.
Tablor:by Guillaume Connan, a program automatically generating LaTeX variation tables, the calculations are performed;s by Giac, cf. the user manual. By combining tablor with pgiac and LaTeX, we simplify the writing of answers, as in this example by G. Connan: PDF, LaTeX.
Kruptor:Kruptor is a package of procedures written in xcas in the Maple style, which makes it possible to easily program demonstrations of the functioning of cryptographic systems. A number of examples are provided in the package.