9720. MathJax Cheat Sheet for Mathematical Notation
MathJax and Time Complexity


Cheat sheet for displaying mathematical notations with MathJax.

1. MathJax

MathJax is a cross-browser JavaScript library that displays mathematical notation in web browsers. Read tutorial Jekyll - Math Symbols with MathJax to learn how to use MathJax in web page and Markdown.

2. MathJax Cheat Sheet

Title Formula Markdown
Variables x1, y1, z3,4 $x_1$, $y_1$, $z_{3,4}$
Square a2, xy, 2n1 $a^2$, $$x^y$, $2^{n-1}$
Square Root 9, x, nx $\sqrt{9}$, $\sqrt{x}$, $\sqrt[n]{x}$
Logarithm logx, log2x $\log{}x$, $\log_{2}x$
Fraction 12, (12)n $\frac{1}{2}$, $\left(-\frac{1}{2}\right)^n$
Infinity $\infty$
Absolute Value |x|, |x2|, x, x $\vert{x}\vert$, $\vert\frac{x}{2}\vert$, $\lfloor{x}\rfloor$, $\lceil{x}\rceil$
Arithmetic Operation 2×3, 6÷3 $2\times 3$, $6\div 3$
Factorial n! $n!$
Trigonometric Functions sinθ, cosθ, tanθ $\sin\theta$, $$\cos\theta$, $\tan\theta$
Greater or Less a>b, ab, a<b, ab $a\gt b$, $a\geq b$, $a\lt b$, $a\leq b$
Equation a=b, ab, ab $a=b$, $a\neq b$, $a\approx b$
Times Dot ab=ab $a\cdot b=ab$
Divide Fraction a/b=ab $a/b=\frac{a}{b}$
Trinomial Equation a2+b2=c2 $a^2 + b^2 = c^2$
Matrix Parentheses (abcd) $$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
Matrix Brackets [abcd] $$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$
Matrix Equation |abcd|=adbc $$\begin{vmatrix} a & b \\ c & d \end{vmatrix}=ad-bc$$
Set xA, Ax, xA $x\in A$, $A\ni x$, $x\notin A$
Subset AB, AB, AB $A\subset B$, $A\subseteq B$, $A \not \subset B$
Intersection & Union AB, AB, ¯A $A\cap B$, $A\cup B$, $\overline{A}$
Quadratic formula x=b±b24ac2a $ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $
Binomial 3x1+(1+x)2 $\sqrt{3x-1}+(1+x)^2$
Differentiation f, f(n), Dxf $f'$, $f^{(n)}$, $D_x f$
Integral 10f(x)dx $\int_0^1 f(x) dx$
Integral Large f(x)dx $\displaystyle \int_{-\infty }^{\infty}f(x)dx$
Max Sample max(a,b)={a(ab)b(a<b) $$\max(a,b)=\begin{cases}a&(a\geqq b)\\b&(a\lt b)\end{cases}$$
Name Notation Markdown
Big O [micron] O or O $\mathcal{O}$ or $O$
Big Omega Ω $\Omega$
Big Theta Θ $\Theta$
Small O [micron] o $o$
Small Omega ω $\omega$
On the order of $\sim$

4. Common Time and Space Complexity

Name Running Time Markdown
Constant Time O(1) $O(1)$
Logarithmic Time O(logn) $O(\log{}n)$
Linear Time O(n) $O(n)$
Quasilinear Time O(nlogn) $O(n\log{}n)$
Quadratic Time O(n2) $O(n^2)$
Cubic Time O(n3) $O(n^3)$
Factorial Time O(n!) $O(n!)$

5. References