Xcas web
Keywords: xcas, firefox, browser, computer algebra system, online, offline

for visually impaired, version francaise.
Welcome to Xcas for Firefox or compatible browser (c) 2020, B. Parisse and R. De Graeve, Institut Fourier, Université de Grenoble. Type python or javascript to switch to MicroPython (Damien P. George et al) or Javascript (QuickJS engine by Fabrice Bellard and Charlie Gordon)
If Xcas doesn't work clear your browser cache and reload
Restore last session
or

### Configuration

personal e-mail default to , help language fr en sp el de Export to Casio Prizm or Fx-9750GIII Numworks TI Nspire CX
Digits: Autosimplification: Syntax , , ,
, , , ,
, ,
Turtle by Out by
Maximal size for matrix assistant , resizable
Documentation online

session
Load

- Type a computation or program in the commandline, for example `1/3+1/6`.
  You can select the Xcas, MicroPython or Javascript interpreter from the settings (button at the top left). The default Javascript interpreter is QuickJS in math mode unless the commandline starts with `@` (QuickJS without math mode) or `@@` (browser Javascript interpreter).
  Helpers are available by pressing `Math` or `Prog` or `123` (scientific keyboard). Press enter or hit ✅ to run the computation.
  Find commandnames with the helpers or by reading the sections below or in the Xcas manual. To get online help on a command, enter the commandname and press the `?` button or F1 key.
- You can share a session by clicking on the ⠪ button. You can exchange Xcas sessions by email. Fill in once the email fields in the Settings (topleft button). You can send a session by clicking on the ✉ link, modify the To field if necessary (if you are using a webmail that is not gmail, copy the x2 link content inside a mail or configure your browser settings for this webmail). When you receive an Xcas session by email, click on the link, this should open the session in your browser. You can modify the session and send it back with the ✉ link.
  When you send a session by email, the filename of the session will be modified by prefixing the sender email, except if the sessionname contains @ (it remains unchanged, except if the filename begins with @, then the leading @ is removed).
  Example: a teacher sends to his students a session named `@exercise` with a mail alias or by sharing on the forum (⠪), the students filename session will be `exercise`, they do the work and send it back to the teacher (✉ link), the session received by the teacher is named with the email address of the student prefixed, it's easy for him to know who he is correcting. The teacher can send the session back, the session name remains unchanged.
- You can optionally install Xcas on your device, in order to run it in airplane mode (without Internet connection).
  To install Xcas for Firefox on a mobile device, download xcashtml.zip, unzip it (for example with Androzip on Android), search the `xcasen.html` file and open it with your browser (Firefox recommended). You can create a shortcut on your welcome screen for easy access.
  On PC/Mac: if you have Xcas native >1.4.9-57 already installed, Xcas for Firefox is already installed, otherwise do like on mobile.
  - Windows: locate the file `xcasen.html` in the `doc` subdirectory inside the install directory of Xcas, by default `c:\xcas`.
  - Mac:`/Applications/usr/share/giac/doc/xcasen.html`,
  - Linux: `/usr/share/giac/doc/xcasen.html`,
  If Xcas for Firefox does not work locally with Firefox, disable `security.fileuri.strict_origin_policy` in `about:config`.
- On browsers that implement webusb, like Chromium of Chrome, you can easily exchange scripts with a Numworks calculator.
  First check in the settings (button at the top left) that export is configured towards the Numworks calculator. Click on the Numworks→ button to download a calculator script and send it back with the →Numworks button. The script name may be modified at the left of the →Numworks button. If the name ends with `xw`, it means you are working on a KhiCAS Numworks session, if it ends with `.py` you are working on a Python script. Then you can share your scripts by email or on public forums (mail button and F button).
  KhiCAS is a version of Xcas for the Numworks calculator Xcas, it can be installed on Numworks N0110 with a version of the OS lower or equal to 15. On this page, you can certify that a Numworks N0110 firmware is genuine KhiCAS. Beware, upgrades from the Numworks official website versions 16 (or more) are incompatible with Xcas and if you upgrade this is irreversible. More information here
  Thanks to à Maxime Friess for the script Numworks.js
- Sessions examples
  - Variables, types, affectation, tests, loop, function, syntax Xcas or Python
  - Turtle Click on
    for examples (not translated).
  - Step by step curve, syntax Xcas or Python
  - approximate curve arc length Python
  - Line equation Xcas or Python
  - Minimum by mean of a table of value Xcas, Python
  - Frequency in a sample Xcas or Python
  - Trial division for prime factorization Xcas, Python
  - Second order equation Xcas, Python
  - Sequences Xcas , Python
  - Binomial and truncated geometric law Xcas, Python
  - Pascal triangle Xcas Python
  - Dichotomy Xcas , Python
  - Approximate area under curve Xcas Python
  - Cumulated frequency normal law
  - Central-limit theorem illustration
- Sessions examples
  - Floating point numbers
  - Linear systems, LU, condition number
  - QR decomposition, least squares, example linear regression
  - Univariate polynomials Horner and Taylor
  - Polynomial interpolation Runge's phenomenom, Tchebyshev points
  - Polynomial GCD from Euclide to sub-resultant
  - Linear algebra over a finite field
  - Groebner basis cyclic6. For more intensive computations, activate wasm in the settings and open cyclic7 (modular). If you want to see informations while a computation is running, run first `debug_infolevel:=1` (or more), then open the browser console. For really large computations, use native Xcas versions.
  - Arithmetic on multivariate polynomials (requires a browser compatible with Web-Assembly, like Firefox ≥ 58). Fateman benchmark for n=20
  - Approx benchmarks
- Exact benchmarks
- Fractals:
  - Mandelbrot Xcas, Python,
  - Newton fractals Xcas, Python

- From the top you will see:
  - a panel of buttons: settings, save/restore session, helpers (Xcas logo maths, programming, scientific keyboard, documentation). Some buttons or links are not visible at startup like the x2 or ✉ links:
    - the x2 (resp. local) link may be used to replicate a session, right-click to copy/paste the link in Xcas native or on a static web page. It is also useful if you stop a computation that would take too long.
    - the ✉ link lets you share your session by e-mail.
  - a help area, where you will see short descriptions of the commands you asked the syntax. You can clear the help area with the erase button at the right of the help search field.
  - the history area contains levels (0 at the beginning), a level is a pair commandline (written in black)/answer (in blue). You can move levels with the ↑ and ↓ buttons. You can modify an existing commandline, update it with the ✅ button or Enter key at the beginning of the field. You can throw a level to the trash with the erase button at the right of the level. You can restore levels from the trash with the Restore button at the bottom of the history, or empty the trash. The link `+` right to the Empty button lets you open a new empty session in a new tab.
  - a commandline, type your command or program there, then tap ✅ or hit Enter (type Ctrl-Enter if your input has several lines, or Enter on a blank line). If you want to force a new line, hit Shift-Enter or tap the `\n` button.
    For example, type `1/2+1/3` or `sin(pi/4)` or `sin(pi/4.0)`.
    The `Math`, `prog` and `123` buttons may be used to help you fill the commandline.
    If you know a commandname, type it (or its first letters), for example `factor` then press the
    key or the
    button. This will display a short help on the command if it exists or give some commandname hints if it does not or is incomplete.
    For example, click on `math` then `rewrite` then `factor` then `?`, look at the short help at the top, click on one example or complete with x^4-1 then type Enter.
    You can select text with the `beg` and `end` buttons, remove selection with `del` and paste selection with `cp`.
    If you evaluate a blank commandline, this will add a comment field. You can convert a commandline into a comment (or a comment into a commandline): type /// at the beginning then Enter. You can comment an exisiting level by pressing the ✎ key. You can write boldface, italic, etc. in a comment using the buttons below the comment or typing HTML code. If you want to render maths, you have two methods
    - enter a valid Xcas input between two dollars (`$...$`), the input will be parsed unevaled and converted to MathML for 2d display. For example `$x[n+1]^2$` will display x with exponent n+1, `$A=[[1,2],[3,4]]$` will display a matrix (it will not modify A), `$integrate(sin(x),x,0,pi)$` will display the integral of sin(x) between 0 and pi (the integral will not be computed), `vector(u), vector(A,B)` will display an arrow over u or AB. Symbols of sets like ℤ,ℕ may be obtained by entering `$ZZ$, $NN$`, for example type `$x in QQ$` to get x∈ℚ. HTML code may also help like `&forall;` for ∀, `&exist;`, `&oplus;`, `&otimes;`, `&notin;`, `&empty;`, `&part;`, etc. or copy/paste a symbol from here.
    - or enter a comment containing at least one pair of double dollars (`$$...$$`), the whole comment will be rendered as a LaTeX formatted comment by loading MathJax (beware that this will not work offline).
  - a console that will display CAS messages, syntax errors or step by step computation for commands that support step by step (like derivative). The console is not displayed if it is empty. You can clear the console or adjust it's height.
  - a graph 3d area for 3d commands. This area is not displayed if it is empty.
  You can save the history by hitting the `💾` button. The filename of the session is displayed in a modifiable text field at the right of the `💾` button, it is `session` by default. You can open a saved session by hitting the `Load` button. You can export your worksheet on desktops, this will save the whole HTML code (instead of the commandlines for a session). 2d graphs can be saved as SVG 1.2 files (save button at the right of the level).
  If you have a native Xcas session, you can open it in Xcas for Firefox (native Xcas menu menu File, Clone or from commandline `xcas --online nom_fichier.xws`).
  Note that Chrome (or the builtin browser of your device) is much slower than Firefox (about 5 times). Moreover Chrome does not have builtin support to display 2d maths with MathML, an additional javascript library (Mathjax) must be retrieved from Internet which is slower and does not work in airplane mode.
  It is therefore recommended to run Xcas for Firefox from Firefox
- Keyboard shortcuts with Alt (or Ctrl if Alt-key is already interpreted by the browser or the OS)
  - D, cursor right: move focus to the right (or down)
  - G, cursor left: move focus to the left (or up)
  - cursor down: move focus to the right/down twice
  - curseur up: move focus to the left/up twice
  - B: move focus to commandline
  - C: copy current field to command line and move focus to commandline
  - A: move focus to help field
  - TAB: display help on the command at the left of the cursor in the commandline.
  - M: display or hide Math menu
  - P: display or hide Program menu
  - T: show turtle menu
  - E or F: exec history
  - N: clears console
- Click on the button at the topleft to modify settings. You can change the default digits number, the angle unit, the step by step mode, etc. If you have a compatible browser, like Firefox≥58, you can enable the `wasm` option (Web-Assembly), this makes most computations faster and give access to PARI-GP commands after running `pari()`.
- Xcas manals
  Most of the documentation is in French, not yet translated. The "hard disk" version of the documentation is available on Linux if you have `giac` installed. Otherwise, please select the Internet version.
  - Xcas reference guide hard disk, Internet,
  - Symbolic and numeric algorithms (FR): PDF hard disk, Internet, HTML hard disk, Internet,
  - Programmation (FR): algorithmique lycée, hard disk, Internet,
  - Geometry (FR): hard disk, Internet,
  - Simulation (FR): hard disk, Internet,
  - Logo turtle (FR): hard disk, Internet,
  - Exercises (FR): hard disk, Internet,
  - Amusement (FR): hard disk, Internet,
- xcasen.html is a javascript interface, optimized for Firefox, of the Giac computer algebra system compiled with emscripten. The text editors are using the CodeMirror javascript library. Unlike many CAS web-interfaces, once the page is loaded, it does not require a server, it runs entirely locally with the javascript engine of your browser. It is slower than native code, about 2 times slower for numeric code, up to 8 times slower for symbolic code. If you run large computations, consider installing Xcas native!
  Giac/Xcas (c) 2018 B. Parisse, R. De Graeve, Institut Fourier, Université de Grenoble, GPL3 license. For commercial license, contact us.
  Optimization, signalprocessing, graph theory code: Luka Marohnić.
  Mathml and SVG code initially written by J.P. Branchard.
  MicroPython (c) Damien P. George et al
  QuickJS (c) Fabrice Bellard and Charlie Gordon.
- There is no universal method to simplify an expression, sometimes it's better to expand, sometimes to factor, sometimes linearize, etc.. It is therefore important to know some rewriting commands, the most important are available by hitting Math then rewrite.
  - For example, hit `math`, `rewrite`, `simpl` this will insert the command
    , type the expression you want to expand and simplify, then Enter.
    ,
    ,
    are somewhat similar, less powerfull and faster: normal does not search relations between trigonometric functions, ratnormal does only rational simplifications. `reorder` reorders a polynomial according to a list of variables.
  - factorizes over R
    over C
  - partial fraction decomposition over R,
    over C.
  - expand trigonometrics, exponentials and logarithms,
    linearizes exponentials,
    linearizes trigonometrics,
  - substitution of one or more variables by one or more values
  - Trigonometric conversions
    ,
    ,
    ,
    ,
  - Others:
    ,
    ,
- - To create a vector, type the coordinates with comma as separator and [] as delimiters.
    scalar product,
    cross product in dimension 2 or 3
  - Matrices are vectors of vectors of the same size and can be typed in the commandline like `A:=[[1,2],[3,4]]`. Alternatively, you can hit `Math` then `matrix` to open the matrix assistant or `rand` for a matrix with random coefficients.
  - Line and column indices begin at 0 when indexed by `[]` and 1 when indexed by `[[]]`, for example
    or
    .
  - You can use `+,-,*` and
    for usual arithmetic operations on matrices.
  - transposed,
    : transconjugate,
    identity;
  - linear system,
    : row reduction to echelon form,
    : determinant,
    : inverse,
    : LU decomposition, can be used in
    ,
  - characteristic polynomial
    minimal polynomial,
    eigenvectors and eigenvalues,
  - Matrix factorizations
    ,
    ,
    ,
  - Norms
    ,
    ,
    :
    (w.r.t L1, L2 or Linf vector space norm)
- Hit `math` then `arit`. Some commands work on integers and polynomials, for example `gcd` or `lcm`. Otherwise, there are two versions, the one working on integers begins with `i`, like `irem` (euclidean remainder for integers) vs `rem` (euclidean remainder for polynomials).
  - ,
    GCD and LCM
  - ,
    ,
    : remainder and quotient (euclidean integer division)
  - extended GCD for integers
    integer solutions of au+bv=c,
    pseudo-primality test,
    ,
    integer factorization,
    indicatrix,
    fast modular powering.
  - ,
    ,
    : remainder and quotient for polynomial euclidean division. The default variable is `x`, it can be specified as 3rd argument.
  - extended gcd for polynomials
    polynomial solutions for au+bv=c
    Horner evaluation,
    polynomial interpolation
  - Use infix `mod` to work in ℤ/nℤ, for example `x^3+5x-11 mod 17` is a polynomial with coefficients in ℤ/17ℤ. If you must work in a non prime finite field, run
- - Equation and system solving: Hit `math` then `solve`, select exact or approx. and real or complex, or enter the commands
    )
  - Differential equation/system solving: Hit `math` then `calc`
    exact solver,
    approx. solver, or `math`, `graph`
    approx. graph.
  - Recurrent sequences: hit `math` then `u_n`. The
    command tries to find an explicit expression for a recurrent sequence.
- Hit `math` then `f(x)` to study a function, or `u_n` for a sequence, or `calc` for calculus commands and assistants for discrete sums (`∑`), limits (`limit`), derivatives (`∂`), antiderivatives and definite integrals (`∫`), series expansions (`series`).
  For example, let's define an univariate function `f`, hit `prog` then `func`, set `f` as function `x` as list of arguments and `sin(x^2)` as returned value. Or type in the commandline
  Once `f` is defined, we can compute the value of the function and derivative like this:
  .
  `'` denotes the derivative with respect to `x`, for other variables, use
  . The antiderivative command is
  , for example
  , or for a definite integral
  .
  The
  et
  commands compute a limit or Taylor series (or asymptotic series expansion) for example
- Hit `math` `rand` opens an assistant that build random numbers.
  Continuous distributions commands
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  .
  Discrete distributions commands
  ,
  ,
  ,
  .
  Cumulated distributions commands have a `_cdf` suffix, one can also get them by passing the distribution law and arguments to the
  command. Inverse cumulated distributions have an `_icdf` suffix, there is also an
  command.
  The
  will display an histogram of a list of value (default class minimum 0, default class size 1, otherwise pass them as arguments).
  The
  command splits a Markov chain transition matrix.
- Hit `math` then `graph` (see also `f(x)` for function variations).,
  Examples of commands
  displays the 2d graph of two expressions simultaneously (sin(x) and x-x^3/6),
  displays the 3d graph of x^2-y^2 together with a plane. You can move the viewpoint with the mouse.
  Some geometry commands:
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  , ...
- The `Prog` displays assistants that will help you enter programmation structures (test, loop, function). You can add newlines with the `\n` button, or with Shift-Enter (or Enter alone if you modify an existing level). `→|` indents the current line. Hit `debug` to run a function in step by step mode, this will display local variables, it's very useful to debug a function.
  You can choose syntax compatibility with C/javascript or Python.
  Example of program: sum of squares in Xcas syntax
  `function f(x)
  local y,s;
  if x > 100000 then return "Number too large"; fi;
  s:=0;
  for y from 1 to x do
  s:=s+y^2;
  od
  return s;
  end:;`
  Python compatible syntax
  `def f(x):
  # local y,s
  if x > 100000:
  return "Number too large"
  s=0
  for y in range(x+1):
  s=s+y**2
  return s
  `
- The turtle is a small robot that moves following the user commands, it will trace the moves with a pen with a selectable color. It may be used to learn programming.
  Click on `Prog` then `Turtle` then `new`
  Two levels are created, the first one is for programs/functions that will be used to make a figure, the second field begins with the command `clearscreen`, it will contain the move commands, including calls to functions defined in the first level. At the right of the `new` button, you can select move commands, `forward` (turtle moves forward n steps, default n=10), `backward`, `tright` (`right` n degrees, default n=90), etc.
  For example, click on the line after `clearscreen`, then `forward` then `tleft`, press Enter, the turtle moves 10 pixels left and will turn left, heading to the top.
  The first field is a normal level where you can write utilities functions, with the help of the prog assistants (test, loop, func).
  Example: square, regular polygons Xcas or Python, Merry Xcas, Merry Xcas (Python version)
  The French turtle manual explain all these commands and contains many examples of scenarios to teach programming to young childrens.

set[]
""
Choose
or
Expression
variable x
xmin -4
xmax 4
xstep 0.0625
Expression
1ère variable x===-3..3
2ème variable y===-3..3
xstep 0.25
ystep 0.25
Choose parametric
or parametric
x(t)=
y(t)=
variablet
tmin -4
tmax 4
tstep 0.0625
x(u,v)=
y(u,v)=
z(u,v)=
1ère variable u===-3..3
2ème variable v===-3..3
ustep 0.25
vstep 0.25
f(x,y)=
Variable xx===-3..3
Variable yy===-3..3
xstep 0.25
ystep 0.25
niveaux=
Slopefield for a differential equation dx/dt=f(x,t) or autonomous 2-d system d[x,y]/dt=f(x,y)
f=
Variable t (or x)t===-3..3
Variable yy===-3..3
xstep 0.25
ystep 0.25
init=
Polar curve
expression
variable θ t
θmin
θmax
θstep
Differential equation
time-variable t, unknown y
Initial conditions (optional)
Series expansion
expression
variable x
at
order
Polynom polynom
Limit :
expression
variable x
at
Direction (optional)
Integration
expression
variable x
from (optional)
to (optional)
Discrete sum
expression
variable j
from (optional)
to (optional)
Derivative
expression
variable x
Number of derivatives 1
Selected law , optional parameters
Choose a law
or
or or or
Mean, Standard deviation, Quartiles, Histogram, Boxwhisker,
Scatterplot Polygonplot, Linear regression
Risk α=

- Confidence interval: (n=≥30, p=), (μ=, σ= n=)
  ,
- Adequation data/data : , , or
- Adequation data/law : or : μ= (σ= optional),
  Alternative H1 <, ≠, >

: by
(j,k)-> (indices from 0 to size-1)
Lines - , columns -
Generation of by or according to a
Integers between 0 and n or n and -n with n=
Choose loop
or
for
from
to
step (optional)
Tests :
while
Solve
equation or system
unknown(s)
Choose
or
Recurrence
Unknown(s) u(n)
Initial conditions u(0)===1
u_(n+1)=f(u_n) with f(x):= and u(0)=
Number of terms n= 10
Function graph between 0 and 2
Tests :
if
then
else (optional)
New function
function namef
arguments x
local variables
returned value
Create a sequence or a table of values,
expression
variable
from
to
Step (optional)
Choose
or
Function study (console) and graph of
f( x) :=
xmin -4
xmax 4
xstep 0.0625
Option : diff
.
x1 (t):=
y1(t):=
tmin -4
tmax 4
tstep 0.0625

# Restoring session

### Console

Downloading...