Modules for calculus and algebra
Almost every computation involves fractions and roots. The pattern
\frac{...}{...} and \sqrt{...} must become automatic.
$$
\frac{1}{1+x^2},\quad
\frac{a+b}{2},\quad
\sqrt{x^2+1},\quad
\sqrt[n]{1+x}
$$
Exercise: write the midpoint formula, the quadratic formula, and one inequality you know
using \frac{...}{...} and \sqrt{...}.
For limits and derivatives, the subscript goes under the \lim and the
variable of differentiation appears in the denominator:
$$
\lim_{x \to 0} \frac{\sin x}{x} = 1
$$
$$
f'(x) = \frac{d}{dx} f(x)
$$
$$
\int_0^1 x^n\,dx = \frac{1}{n+1}
$$
Exercise: write the definition of the derivative of a function at a point using
\lim and \frac{...}{...}.
Summations and products carry lower and upper indices and often include conditions:
$$
\sum_{n=0}^{\infty} a_n x^n
$$
$$
\sum_{k=1}^{n} k = \frac{n(n+1)}{2}
$$
$$
\prod_{p \leq n} p
$$
Exercise: type the geometric series
\(\sum_{n=0}^{\infty} ar^n\) and its closed form, then specialise to your favourite value
of \(r\).
Use pmatrix for matrices with parentheses and \det or
vertical bars for determinants:
$$
A =
\begin{pmatrix}
1 & 2 \\
3 & 4
\end{pmatrix},
\quad
\det(A) = 1\cdot 4 - 2\cdot 3 = -2.
$$
$$
\mathbf{v} = (v_1,\dots,v_n),\quad
\langle x, y \rangle = \sum_{i=1}^n x_i y_i.
$$
Exercise: write the 3×3 identity matrix, a diagonal matrix, and the determinant of a 3×3
upper triangular matrix.