Math Formulas Stress Test
Exercises KaTeX rendering: inline math, display math, matrices, fractions, integrals, summations, Greek letters, accents, and aligned environments.
1. Inline math density
The Pythagorean theorem $a^2 + b^2 = c^2$ predates calculus, while Euler’s identity $e^{i\pi} + 1 = 0$ ties together five constants. The Riemann zeta function $\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s}$ converges for $\Re(s) > 1$, and its non-trivial zeros lie on the critical line $\Re(s) = \tfrac{1}{2}$. The fundamental theorem of calculus relates $\int_a^b f’(x),dx = f(b) – f(a)$ to differentiation. The chain rule $\frac{d}{dx}f(g(x)) = f’(g(x)) \cdot g’(x)$ underlies backpropagation. Gradient descent updates weights by $\theta \leftarrow \theta – \eta \nabla_\theta J(\theta)$. The softmax $\sigma(z)i = \frac{e^{z_i}}{\sum{j} e^{z_j}}$ converts logits to probabilities. Cross-entropy $H(p, q) = -\sum_i p_i \log q_i$ measures divergence. Variance is $\operatorname{Var}(X) = \mathbb{E}[(X – \mu)^2]$.
2. Display math
2.1 Calculus
$$ \int_{-\infty}^{\infty} e^{-x^2},dx = \sqrt{\pi} $$
$$ \frac{\partial}{\partial t} \rho + \nabla \cdot (\rho \mathbf{v}) = 0 $$
$$ \oint_{\partial \Omega} \mathbf{F} \cdot d\mathbf{l} = \iint_{\Omega} (\nabla \times \mathbf{F}) \cdot d\mathbf{A} $$
2.2 Series and limits
$$ \sum_{n=0}^{\infty} \frac{x^n}{n!} = e^x $$
$$ \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n = e $$
$$ \zeta(2) = \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6} $$
2.3 Linear algebra
$$ \det(A) = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) \prod_{i=1}^{n} a_{i, \sigma(i)} $$
$$ A = \begin{pmatrix} a_{11} & a_{12} & a_{13} \ a_{21} & a_{22} & a_{23} \ a_{31} & a_{32} & a_{33} \end{pmatrix} $$
$$ \begin{vmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{vmatrix} = 0 $$
2.4 Aligned equations
$$ \begin{aligned} (x + y)^2 &= x^2 + 2xy + y^2 \ (x – y)^2 &= x^2 – 2xy + y^2 \ (x + y)(x – y) &= x^2 – y^2 \ (a + b)^3 &= a^3 + 3a^2 b + 3a b^2 + b^3 \end{aligned} $$
2.5 Cases
$$ |x| = \begin{cases} x & \text{if } x \geq 0 \ -x & \text{if } x < 0 \end{cases} $$
$$ \delta_{ij} = \begin{cases} 1 & \text{if } i = j \ 0 & \text{otherwise} \end{cases} $$
3. Probability and statistics
$$ P(A \mid B) = \frac{P(B \mid A) P(A)}{P(B)} $$
$$ \mathcal{N}(x; \mu, \sigma^2) = \frac{1}{\sigma \sqrt{2\pi}} \exp\left(-\frac{(x – \mu)^2}{2\sigma^2}\right) $$
$$ \mathbb{E}[X] = \int_{-\infty}^{\infty} x f(x),dx $$
$$ \hat{\theta}{\text{MLE}} = \arg\max{\theta} \prod_{i=1}^{N} p(x_i \mid \theta) $$
4. Physics
4.1 Maxwell
$$ \begin{aligned} \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \ \nabla \cdot \mathbf{B} &= 0 \ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \ \nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \end{aligned} $$
4.2 Schrödinger
$$ i\hbar \frac{\partial}{\partial t} \Psi(\mathbf{r}, t) = \hat{H} \Psi(\mathbf{r}, t) $$
4.3 Relativity
$$ ds^2 = -c^2,dt^2 + dx^2 + dy^2 + dz^2 $$
$$ G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu} $$
5. Set theory and logic
$$ \forall x \in X,\ \exists y \in Y : f(x) = y $$
$$ A \cup B = {x \mid x \in A \lor x \in B} $$
$$ A \cap B = {x \mid x \in A \land x \in B} $$
6. Big-O / complexity
| Algorithm | Time | Space |
|---|---|---|
| Quicksort (avg) | $O(n \log n)$ | $O(\log n)$ |
| Mergesort | $\Theta(n \log n)$ | $O(n)$ |
| Bubble sort | $O(n^2)$ | $O(1)$ |
| Hash lookup | $O(1)$ amortised | $O(n)$ |
| BFS / DFS | $O(V + E)$ | $O(V)$ |
7. Greek + accents + arrows
$\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi, \omicron, \pi, \rho, \sigma, \tau, \upsilon, \phi, \chi, \psi, \omega$
$\Alpha, \Beta, \Gamma, \Delta, \Epsilon, \Zeta, \Eta, \Theta, \Iota, \Kappa, \Lambda, \Mu, \Nu, \Xi, \Pi, \Rho, \Sigma, \Tau, \Phi, \Psi, \Omega$
$\hat{a},\ \bar{a},\ \tilde{a},\ \vec{a},\ \dot{a},\ \ddot{a},\ \mathbf{a},\ \mathbb{R},\ \mathcal{F},\ \mathfrak{g}$
$\to,\ \rightarrow,\ \Rightarrow,\ \Leftrightarrow,\ \mapsto,\ \hookrightarrow,\ \rightleftharpoons$