Section 3 Maths

Inline maths
Maths in a sentence are surrounded by
$
and
$
.
The equation $e^{\pi i}+1=0$ holds.
The equation ​\(e^{\pi i}+1=0\) holds.
Display maths
To display a math expression, it is placed between
\[
and
\]
.
The equation
\[
    e^{\pi i}+1=0
\]
holds.
The equation
\[ e^{\pi i}+1=0 \]
holds.
Numbers and variables
Variables in a formula are in italic typeface.
$1+1$
   ​\(1+1\)
$3.141592$
   ​\(3.141592\)
$1+2i$
   ​\(1+2i\)
$z=2a+3y$
   ​\(z=2a+3y\)
$f(x)=-x+5$
   ​\(f(x)=-x+5\)
Superscripts and subscripts
Use
^
to attach superscripts and use
_
for subscripts.
$x_2 + y^{-2}$
   ​\(x_2 + y^{-2}\)
$x_1 + y_2$
   ​\(x_1 + y_2\)
$e^{1234}$
   ​\(e^{1234}\)
$x^3-3x^2+3x-1=(x-1)^3$
   ​\(x^3-3x^2+3x-1=(x-1)^3\)
Fractions
$-\frac{2}{3}$
   ​\(-\frac{2}{3}\)
$\frac{c}{a+b}$
   ​\(\frac{c}{a+b}\)
Roots
$\sqrt{2}$
   ​\(\sqrt {2}\)
$\frac{-b+\sqrt{b+4ac}}{2a}$
   ​\(\frac{-b+\sqrt {b+4ac}}{2a}\)
Special symbols
$\pm$
   ​\(\pm \)
Greek letters
$\pi$
   ​\(\pi \)
Trigonometric functions
$\sin(\pi)$
   ​\(\sin (\pi )\)
$\cos(-\pi)$
   ​\(\cos (-\pi )\)
$\tan(\frac{4}{\pi})$
   ​\(\tan (\frac{4}{\pi })\)
Operators
$A\cap B$
   ​\(A\cap B\)
$A\cup B$
   ​\(A\cup B\)
Relations
$A\subset B$
   ​\(A\subset B\)
$A\supset B$
   ​\(A\supset B\)
$A\subseteq B$
   ​\(A\subseteq B\)
$A\subsetneq B$
   ​\(A\subsetneq B\)
Inequalities
$2>-3$
   ​\(2>-3\)
$2\ge -3$
   ​\(2\ge -3\)
$-2<3$
   ​\(-2<3\)
$a\le a^2$
   ​\(a\le a^2\)
Parentheses
$a(b+c)$
   ​\(a(b+c)\)
$a\left(\frac{1}{2}(b+c)\right)$
   ​\(a\left(\frac{1}{2}(b+c)\right)\)
Binomial coefficients
$\binom{10}{5}$
   ​\(\binom{10}{5}\)
$\binom{n}{k}$
   ​\(\binom{n}{k}\)
Sum and products
$\sum_{n=1}^{10}n^2$
   ​\(\sum _{n=1}^{10}n^2\)
$\prod_{n=1}^{10}n^2$
   ​\(\prod _{n=1}^{10}n^2\)
limits
$\lim_{x\to 0}\frac{1}{x}$
   ​\(\lim _{x\to 0}\frac{1}{x}\)
$\lim_{x\to\infty} a_n$
   ​\(\lim _{x\to \infty } a_n\)
Differentiations
$\frac{dy}{dx}$
   ​\(\frac{dy}{dx}\)
$f'(x)=\cos(x)$
   ​\(f'(x)=\cos (x)\)
Integrals
$\int_{-1}^2e^x dx$
   ​\(\int _{-1}^2e^x dx\)
\[
    \int_{-1}^2e^x dx
\]
\[ \int _{-1}^2e^x dx \]
$\int\sin(x)dx=-\cos(x)+C$
   ​\(\int \sin (x)dx=-\cos (x)+C\)
\[
    \int\sin(x)dx=-\cos(x)+C
\]
\[ \int \sin (x)dx=-\cos (x)+C \]
Matrices
\[
    \begin{bmatrix}
    1 & 2 \\
    3 & 4
    \end{bmatrix}
\]
\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \]
\[
    \begin{matrix}
    1 & 2 \\
    3 & 4
    \end{matrix}
\]
\[ \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix} \]
\[
    \left\{\begin{matrix}
    1 & 2 \\
    3 & 4
    \end{matrix}\right.
\]
\[ \left\{ \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix}\right. \]
Array
\[
    \begin{array}{|rl|}
    \hline
    a & b \\
    aa & bb \\
    \hline
    c & d \\
    cc & dd \\
    \hline
    \end{array}
\]
\[ \begin{array}{|rl|} \hline a & b \\ aa & bb \\ \hline c & d \\ cc & dd \\ \hline \end{array} \]