Xcas, the Swiss army knife of mathematics
🛈 Last update June 2024, stable version 1.9.0992.
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).
Xcas in a nutshell
 Xcas is a Giac interface, which allows computer algebra, graphical representations
in the plane or space, dynamic geometry (in the plane or in space), spreadsheet, statistics and
programming .
Xcas uses the FLTK graphics library, there is an alternative project based on QT:
qcas.
 Xcas offline in your browser is a slightly less complete Giac interface but usable
without any installation from a compatible browser, Firefox is recommended.
 Giac, is the calculation engine of Xcas, it is a C++ library. It can be used in C++
programs but also from Python, Julia, Java and JavaScript .
Examples of software using Giac: Geogebra (Java and Javascript), HP Prime calculator (C++), Pocket
CAS (C++), CAS Calc P11 (C++). Giac can optionally be used from sage.
 Giac/Xcas has a compatibility mode for people accustomed to computer algebra software Maple
or MuPAD as well as for users of TI calculators (TI89/TI92/Voyage 200/TI Nspire CAS).
 A brief history : the project began in 2000, following the writing of computer algebra
software for HP calculators. It now includes a little over 150,000 lines of C++ code (mainly by B.
Parisse), over 1,000 pages of documentation in French (mainly by R. De Graeve), interfaces as a
calculation engine with php , latex, texmacs, java, javascript, python (see above Giac), and
interfaces to use the C/C++ libraries PARI, NTL, CoCoA, GSL, GMP, MPFR. Giac's algorithms are
particularly optimized for the most requested operations (multiplication, division of polynomials,
GCD has several variables on Q, extensions of Q, Groebner bases).
In 2007, Giac/Xcas won third prize at the Free Software Trophies in the scientific software
category.
In 2013, Giac was chosen as a computer algebra engine by the wellknown software Geogebra, as
well as by HP for its HP Prime calculator.
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 : 2d display of expressions, possibility to work on subexpressions.
Physical units : usual operations and conversion
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) ...
2d geometry / 3d 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 1d 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
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 aptget install pythongiacpy OR
sudo aptget install python3giacpy.
Example of commands: launch the python interpreter then input:
from giacpy import *
ifactor(2**128+1)
x=giac('x')
f=factor(x**101)
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 with
livetexmacs), 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/sitelisp/mupacs.el")
in
~/.emacs
, then
Escapex mupadrun 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 JeanMichel 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^41)}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 fullscale 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

Xcas
sheets, the essentials to get started

Xcas tutorial (R. De Graeve, B. Parisse, B.Ycart) in
PDF ,
TeX format.

Interface xcas (R. De Graeve) in
PDF format.

Presentation of the possibilities of Xcas
with exercises corrected by Renée De Graeve.

Computer algebra by Renée De Graeve in
PDF ,
LaTeX format.

Programming by Renée De Graeve in
PDF ,
LaTeX format.

Geometry by Renée De Graeve in
PDF ,
LaTeX format.

Simulation
by Renée De Graeve,
PDF ,
LaTeX ,

Turtle logo
by Renée De Graeve,
PDF and
LaTeX , user guide , sample activities at school
PDF.

Exercises
by Renée De Graeve,
PDF and
LaTeX format.

Amusements
by Renée De Graeve,
PDF and
LaTeX

Puzzle
of Dudeney
, by Renée De Graeve, source.

Xcas
and third grade mathematics/b>
by Renée De Graeve,

Algorithms
by Bernard Parisse,
PDF ,
LaTeX

All HTML documentation in one
archive
About xcas
Web pages talking about Xcas:
Books and manuals talking about Xcas:

Calculation guide with free software XCAS, Scilab, Bc, Gp, GnuPlot, Maxima, MuPAD... , by G.
Connan and S. Grognet (Dunod ed.)

Introduction to algorithms and programming for high school (Texas & CasioAlgobox & Xcas), by Luc
Ponsonnet (ellipses)
 Hachette high school:
2nd,
1st
S
 Bordas high school:
1st S
 Nathan high school
2nd
 Didier high school
math'x
 Hatier high school
2nd,
1st S

Mathematics for the
DUT Biological Engineering Course and Corrected Exercises, by Cedric Noel, 2015, ellipses.

Basics of mathematics for geology and geography, Corrected lessons and exercises, by
Sandrine Fleurant and Cyril Fleurant, 2016, Dunod.
Programs using Xcas:
Geogebra:in the CAS view
Facilimaths:Online exercises
(high school level), also offers a PHP extension for Giac. By JeanPierre 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.