Skip to content

Tutorials

A guided path through Mathilda, from your first REPL session to writing your own pattern-based rules, doing symbolic calculus, and closing infinite series and products into constants. Every example is worked end to end and verified against the current Mathilda build.

Work through them in order if you're new — each one builds on the last.

  • 1. Getting started

    Build Mathilda, launch the REPL, understand In[]/Out[], learn the surface syntax, and get help on any function with ?Name.

  • 2. Expressions & evaluation

    Everything is an expression. Meet FullForm, Head, the attribute system, the fixed-point evaluator, and how Hold suspends evaluation.

  • 3. Pattern matching & rules

    Blanks and named patterns, conditions and tests, transformation rules (->, :>), replacement (/., //.), and defining your own functions.

  • 4. Arithmetic

    Exact integers and rationals, fast machine-precision reals, and arbitrary-precision arithmetic (N, Precision); the basic operators, digit and radix manipulation, and combinatorial functions.

  • 5. Number theory

    GCD, ExtendedGCD, modular arithmetic and PowerMod, primes (PrimeQ, FactorInteger, NextPrime), EulerPhi, and continued fractions — up to RSA-style worked examples.

  • 6. Algebra

    Expand and factor polynomials, dissect and divide them, reshape rational expressions with Together/Apart, simplify, and put the polynomial toolkit (Resultant, GroebnerBasis) to work on real problems.

  • 7. Solutions of equations

    Solve polynomial, transcendental, and simultaneous equations with Solve; Root objects and ToRadicals; eliminate variables with Eliminate; and tackle geometry and optimisation problems.

  • 8. Calculus

    Differentiate and integrate, expand power series, take limits, evaluate symbolic sums, and find roots and extrema numerically.

  • Integration methods

    Advanced, per-method deep dives into Integrate's cascade — the transcendental Risch decision procedure and Cherry's special-function extensions (erf, Ei, li, dilogarithm), the Mellin transform engine for half-line integrals \(\int_0^\infty x^{s-1} f\,dx\), and the residue theorem engine for improper, periodic, and contour integrals. Algorithm, references, and worked examples.

  • 9. Numerical calculus

    When there is no closed form: numerical integration, differentiation, summation, products, limits, series, and residues — NIntegrate, ND, NSum, NProduct, NLimit, NSeries, NResidue.

  • 10. Special functions

    The higher transcendental functions: Gamma, Zeta, PolyGamma, Erf, PolyLog, the Bernoulli and Euler numbers, and the hypergeometric family — with their exact reductions and numerical values.

  • 11. Symbolic summation

    Close infinite series into constants with Sum: telescoping and Gosper's algorithm, the Basel problem and the zeta family, Euler sums and multiple zeta values, binomial sums, and the hypergeometric machines for π.

  • 12. Infinite products

    Evaluate infinite products with Product: rational telescoping, the Wallis/Viète trigonometric factorizations, Euler prime products for ζ, and the exponential products for e, γ, and Glaisher's constant.

  • 13. BLAS kernels

    Call the machine-precision BLAS kernels directly through the BLAS` context: dot products and norms, dgemv, dgemm, the symmetric and triangular Level-3 routines, and their complex z* counterparts.

  • 14. LAPACK drivers

    Solve systems and least squares, factor matrices (LU, QR, Cholesky), compute the SVD, and solve symmetric and general eigenproblems with the LAPACK` context.

Following along

Start the REPL with ./Mathilda and type each In[...] line yourself (without the prompt). Press Return to evaluate. End a line with \ to continue a long expression onto the next line.