Download notebook
Inspect locally

Do not run the notebook before reviewing it. Verify the archive, then use KaimonSlate's inactive view, which does not start a worker or evaluate cells.

using DocumenterSlate
verify_slate_bundle("giac_tour.tar.gz")
using KaimonSlate
KaimonSlate.serve_notebook("giac_tour.jl"; inactive = true)
Download and inspect safely

This notebook is arbitrary code. Instantiating its environment may run package build scripts, and live opening may execute cells.

Download source · Checksums · Provenance · Local instructions

Verify after downloading the directory: sha256sum -c SHA256SUMS.

Inspect without starting a worker or executing cells:

using KaimonSlate
KaimonSlate.serve_notebook("giac_tour.jl"; inactive = true)
ArtifactSHA-256
Dockerfile25da180af2270a539f8a8e91d3af1bdf0767064bde4b32dc040b256430fad4da
Manifest.tomlf2810a9c1f516c881f51e12fab61cc4585349cfe850622943394aa8a08efc065
PROVENANCE.tomleefd569f89470c48de143a2e6630ec974f70ae2599d8ce31483230bc6c2dc577
Project.toml47810962ec0e39b7dd20de00dcef692ba653519f69bb872450bf0eaa67688d07
README.md1cafa944a60cf3a228806b9042cd239a667850212d989124a9c06a51b2ddc886
devcontainer.json8be8328084037687160df70959100eac8afd58b6ea8ffba04e33851a5abd002f
giac_tour.jl3fe5869421a9563bd3bb8eabeeef6024ab73cdfe2e7d135b51f16083c41fce97
giac_tour.tar.gzecf1d6063b881d4f129ca7da92df75fddbe0a9f9f36746a43d39bbc66b4757b8
ready — Giac (Xcas engine) + inline-math controls loaded; symbols x y z t s a b k n

A Tour of GIAC

The whole Xcas computer-algebra engine, through live math fields

Every boxed expression below is a live math field (the giac"…" inline control). Click one, edit the math, press <kbd>Enter</kbd> — the cell recomputes and the answer updates. Each giac"…" is ordinary Xcas source, so all ~1800 GIAC commands are one keystroke away.

This is a working map of what the engine does well — algebra, calculus, linear algebra, number theory, transforms — and, at the end, an honest "here be dragons" list of the sharp edges I hit while building it.

1 · Algebra

The bread and butter: expand, factor, and simplify. The field holds the input; the cell's output is what GIAC makes of it. Try editing an exponent.

factor(giac"x^6 - 1")
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000770))
expand(giac"(x + 2*y - 1)^3")
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000772))
simplify(giac"(x^3 - x)/(x^2 - 1) + (2*x)/(x+1)")
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000774))
partfrac(giac"(2*x + 3)/(x^2 - 3*x + 2)")
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000776))

2 · Calculus

Derivatives, indefinite and definite integrals, limits, and series — the engine does them symbolically and exactly.

diff(giac"x^x + ln(x)*sin(x)", x)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000778))
integrate(giac"1/(x^2 + x + 1)", x)
Giac.GiacExpr(Ptr{Nothing}(0x000000000000077a))
(Giac.GiacExpr(Ptr{Nothing}(0x000000000000077e)), Giac.GiacExpr(Ptr{Nothing}(0x000000000000077f)))

Two classics, evaluated exactly and dropped straight into prose by double-brace interpolation: the Gaussian integral $\int_{-\infty}^{\infty} e^{-x^2}\,dx = {{ gauss }}$ and the Basel sum $\sum_{k=1}^{\infty} \tfrac{1}{k^2} = {{ basel }}$.

taylor(giac"exp(sin(x))", x, 0, 6)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000781))

3 · Solving equations & ODEs

solve handles polynomial and transcendental equations (real roots); csolve finds complex ones; desolve integrates differential equations, initial conditions and all.

solve(giac"x^3 - 6*x^2 + 11*x - 6 = 0", x)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000783))
csolve(giac"x^4 + 1 = 0", x)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000785))
# Damped oscillator released from rest at y=1:  y'' + y' + 4y = 0.
# The whole call lives in one field so the `and`-joined conditions reach
# desolve unevaluated (see the "dragons" note at the end).
giac"desolve(y''+y'+4*y=0 and y(0)=1 and y'(0)=0, y(t))"
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000786))

4 · Linear algebra

Matrices are just nested lists, [[…],[…]], and they typeset as real matrices. Determinant, inverse, reduced row echelon form, eigenvalues, characteristic polynomial — all exact.

A = giac"inv([[1, 2, 0], [0, 1, 3], [2, 0, 1]])"
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000787))
M = giac"matrix([[2,1,0],[1,2,1],[0,1,2]])"
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000788))
# Eigenvalues of a symmetric matrix (exact, with multiplicity)
eigenvalues(M)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000789))
# Characteristic polynomial in λ (here written l)
charpoly(M)
Giac.GiacExpr(Ptr{Nothing}(0x000000000000078a))

5 · Number theory & exact arithmetic

Arbitrary-precision integers, primes, totients, the Chinese remainder theorem — and gcd even works on polynomials.

# The SAME gcd, on polynomials instead of integers:
giac"gcd(x^4 - 1, x^6 - 1)"
Giac.GiacExpr(Ptr{Nothing}(0x000000000000078b))
# Exact big integers: the next prime after a quintillion (10^18):
giac"nextprime(10^18)"
Giac.GiacExpr(Ptr{Nothing}(0x000000000000078c))
# Chinese remainder theorem: the x with x≡2 (mod 3), x≡3 (mod 5), x≡2 (mod 7).
# Result [r, m] means x ≡ r (mod m).
giac"chrem([2, 3, 2], [3, 5, 7])"
Giac.GiacExpr(Ptr{Nothing}(0x000000000000078d))

Prime factorization: ifactor vs ifactors

ifactor factors an integer and typesets the prime-power product directly; ifactors (with the s) instead returns the flat [prime, exponent, …] list — handier when you want to consume the factorization programmatically rather than just read it off the page.

ifactor(360)
Giac.GiacExpr(Ptr{Nothing}(0x000000000000078e))
ifactors(360)
Giac.GiacExpr(Ptr{Nothing}(0x000000000000078f))

6 · Integral transforms

Laplace (and its inverse), Fourier, and the z-transform — the machinery behind the Laplace lesson.

# Laplace transform of a damped oscillation:
laplace(giac"exp(-a*t)*cos(b*t)", t, s)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000791))
# Fourier transform of a Gaussian is a Gaussian:
fourier(giac"exp(-x^2)", x, s)
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000793))

7 · Trigonometry

GIAC pivots freely between product, sum, and exponential forms — trigexpand opens multiple angles, tlin linearises products into sums.

trigexpand(giac"cos(3*x)")
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000795))
# Linearise a product of sines into a sum:
tlin(giac"sin(x)*sin(2*x)*sin(3*x)")
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000797))

8 · Complex numbers

i is the imaginary unit. Split into real and imaginary parts, take moduli and arguments, or watch Euler's identity fall out.

# Real and imaginary parts of a complex quotient:
giac"re((3 + 4*i)/(1 - 2*i)) + i*im((3 + 4*i)/(1 - 2*i))"
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000798))
# A root of unity, in exact rectangular form:
giac"exp(i*pi/3)"
Giac.GiacExpr(Ptr{Nothing}(0x0000000000000799))

9 · 🐉 Here be dragons

The engine is enormous and mostly delightful, but building this tour turned up real sharp edges — worth knowing before you trust a result:

  • desolve is picky, and fails silently. Passing conditions as a list, desolve([ode, y(0)=1], y), returns an empty [] rather than erroring. Join them with and: desolve(ode and y(0)=1 and y'(0)=0, y(t)). And keep the whole call inside one giac"…" field — the command(giac"…") form evaluates the and-conditions to false before desolve ever sees them.
  • Singular integrals are taken at face value. integrate(1/x, x, -1, 1) returns 0. The integrand blows up at 0; GIAC hands back the (formal) principal value with no warning.
  • mod is a residue class, not a remainder. 173 mod 12 is 5 % 12, a live modular object — arithmetic stays in ℤ/12. For the plain integer 5, use irem(173, 12).
  • Bare symbols are assumed real. conj(y) gives y and im(y) gives 0 until you declare assume(y, complex).
  • Series carry their remainder. taylor/series results include an order_size(x) tail marking the truncation order.