KaTeX Math Demo

By Goosequill
1 minute read

This post is a quick demo to verify that KaTeX rendering works correctly.

Inline math

Einstein’s mass-energy equivalence: E=mc2E = mc^2.

For a0a \ne 0, the quadratic equation ax2+bx+c=0ax^2 + bx + c = 0 has solutions x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

Display math

The Gaussian summation formula:

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}

Euler’s identity:

eiπ+1=0e^{i\pi} + 1 = 0

Matrix

A=[123456789]A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}

Piecewise function

f(x)={x2,x0x,x<0f(x) = \begin{cases} x^2, & x \ge 0 \\ -x, & x < 0 \end{cases}

Integral and limit

01x2dx=13\int_0^1 x^2\,dx = \frac{1}{3} limx0sinxx=1\lim_{x \to 0} \frac{\sin x}{x} = 1