# Extension:Math/MathJax testing

MathJax is a JavaScript display engine for mathematics. It's an alternative to PNG rendering for Wikimedia sites. MathJax is slower to render, but more scalable (infinite zoom) and manipulable than PNG.

MathJax is currently enabled on this wiki (mediawiki.org), but you have to explicitly enable it in your user preferences (under Appearance -> Math). Otherwise you'll still see the old-school PNG images.

How to test:

## Examples and tests

Most of the following examples were copied from the English Wikipedia math help page.

${\displaystyle ax^{2}+bx+c=0}$
$ax^2 + bx + c = 0$


### Quadratic polynomial (force PNG rendering)

${\displaystyle ax^{2}+bx+c=0\,\!}$
$ax^2 + bx + c = 0\,\!$


${\displaystyle x={-b\pm {\sqrt {b^{2}-4ac}} \over 2a}}$
$x={-b\pm\sqrt{b^2-4ac} \over 2a}$


### Tall parentheses and fractions

${\displaystyle 2=\left({\frac {\left(3-x\right)\times 2}{3-x}}\right)}$
$2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right)$

${\displaystyle S_{\text{new}}=S_{\text{old}}-{\frac {\left(5-T\right)^{2}}{2}}}$
 $S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}$


${\displaystyle {\text{full month's benefits}}\times {\frac {({\text{number of days in month}}+1-{\text{date of application}})}{\text{number of days in month}}}={\text{allotment}}}$

### Integrals

${\displaystyle \int _{a}^{x}\!\!\!\int _{a}^{s}f(y)\,dy\,ds=\int _{a}^{x}f(y)(x-y)\,dy}$
$\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy$


### Summation

${\displaystyle \sum _{i=0}^{n-1}i}$
$\sum_{i=0}^{n-1} i$

${\displaystyle \sum _{m=1}^{\infty }\sum _{n=1}^{\infty }{\frac {m^{2}\,n}{3^{m}\left(m\,3^{n}+n\,3^{m}\right)}}}$
$\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n} {3^m\left(m\,3^n+n\,3^m\right)}$


### Differential equation

${\displaystyle u''+p(x)u'+q(x)u=f(x),\quad x>a}$
$u'' + p(x)u' + q(x)u=f(x),\quad x>a$


### Complex numbers

${\displaystyle |{\bar {z}}|=|z|,|({\bar {z}})^{n}|=|z|^{n},\arg(z^{n})=n\arg(z)}$
$|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)$


### Limits

${\displaystyle \lim _{z\rightarrow z_{0}}f(z)=f(z_{0})}$
$\lim_{z\rightarrow z_0} f(z)=f(z_0)$


### Integral equation

${\displaystyle \phi _{n}(\kappa )={\frac {1}{4\pi ^{2}\kappa ^{2}}}\int _{0}^{\infty }{\frac {\sin(\kappa R)}{\kappa R}}{\frac {\partial }{\partial R}}\left[R^{2}{\frac {\partial D_{n}(R)}{\partial R}}\right]\,dR}$
$\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R} \left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR$


### Example

${\displaystyle \phi _{n}(\kappa )=0.033C_{n}^{2}\kappa ^{-11/3},\quad {\frac {1}{L_{0}}}\ll \kappa \ll {\frac {1}{l_{0}}}}$
$\phi_n(\kappa) = 0.033C_n^2\kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}$


### Continuation and cases

${\displaystyle f(x)={\begin{cases}1&-1\leq x<0\\{\frac {1}{2}}&x=0\\1-x^{2}&{\text{otherwise}}\end{cases}}}$
$f(x) = \begin{cases} 1 & -1 \le x < 0 \\ \frac{1}{2} & x = 0 \\ 1 - x^2 & \text{otherwise} \end{cases}$


### Prefixed subscript

${\displaystyle {}_{p}F_{q}(a_{1},\dots ,a_{p};c_{1},\dots ,c_{q};z)=\sum _{n=0}^{\infty }{\frac {(a_{1})_{n}\cdots (a_{p})_{n}}{(c_{1})_{n}\cdots (c_{q})_{n}}}{\frac {z^{n}}{n!}}}$
${}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z) = \sum_{n=0}^\infty \frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n} \frac{z^n}{n!}$


### Fraction and small fraction

${\displaystyle {\frac {a}{b}}\ {\tfrac {a}{b}}}$
$\frac{a}{b}\ \tfrac{a}{b}$


${\displaystyle S=dD\,\sin \alpha \!}$
$S=dD\,\sin\alpha\!$


### Volume of a sphere-stand

${\displaystyle V={\tfrac {1}{6}}\pi h\left[3\left(r_{1}^{2}+r_{2}^{2}\right)+h^{2}\right]}$
$V=\tfrac16\pi h\left[3\left(r_1^2+r_2^2\right)+h^2\right]$


### Multiple equations

{\displaystyle {\begin{aligned}u&={\tfrac {1}{\sqrt {2}}}(x+y)\qquad &x&={\tfrac {1}{\sqrt {2}}}(u+v)\\v&={\tfrac {1}{\sqrt {2}}}(x-y)\qquad &y&={\tfrac {1}{\sqrt {2}}}(u-v)\end{aligned}}}

{\begin{aligned}q_{1}&=\cos \left({\frac {\phi -\psi }{2}}\right)\sin \left({\frac {\theta }{2}}\right)\\q_{2}&=\sin \left({\frac {\phi -\psi }{2}}\right)\sin \left({\frac {\theta }{2}}\right)\\q_{3}&=\sin \left({\frac {\phi +\psi }{2}}\right)\cos \left({\frac {\theta }{2}}\right)\\q_{4}&=\cos \left({\frac {\phi +\psi }{2}}\right)\cos \left({\frac {\theta }{2}}\right)\end{aligned}}


${\displaystyle 1<2\&3>4}$
{\displaystyle {\begin{aligned}1<2&3>4\end{aligned}}}

$\displaystyle {{\upgamma}_{\text{S}}}={{\uprho}_{\text{S}}}\cdot \text{g}\quad[\text{kN}/\text{m}^\text{3}$

### Equation references

$\displaystyle \label{eq1} x = \sin(y)$

The above has label $\displaystyle \ref{eq1}$

$$$\label{eq1} x = \sin(y)$$$
The above has label $\ref{eq1}$


### CJK

$\displaystyle 中文$
${\displaystyle {\text{中文}}}$($\text{中文}$ displays nothing)
$\displaystyle 中\text{文}$

### Textstyles

${\displaystyle {\textbf {boldtext}}}$
${\displaystyle {\textit {itallictext}}}$
${\displaystyle {\textrm {romantext}}}$
${\displaystyle {\texttt {teletypetext}}}$ should render as $\displaystyle {\tt teletype\ text}$
${\displaystyle {\textsf {sanseriftext}}}$ should render as $\displaystyle {\sf sanserif\ text}$
$\displaystyle {\emph {emphasizedtext}}$

Also in Latex 2e

$\displaystyle \textmd{midsize text}$ should render as $\displaystyle {\md midsize\ text}$
$\displaystyle \textup{upper case text}$ should render as $\displaystyle {\up upper\ case\ text}$
$\displaystyle \textsl{slanted text}$ should render as $\displaystyle {\sl slanted\ text}$
$\displaystyle \textsc{small cap text}$ should render as $\displaystyle {\sc small\ cap\ text}$

Nesting

${\displaystyle {\textit {\textbf {Nestedboldanditallic}}}}$
${\displaystyle {\textbf {\textit {Nesteditallicandbold}}}}$
$\displaystyle \textbf{\upgamma{Mathroman}}$

Math font styles

${\displaystyle \mathbf {bold\ text} }$
${\displaystyle {\mathit {itallic\ text}}}$
${\displaystyle \mathrm {roman\ text} }$
${\displaystyle {\mathtt {teletype\ text}}}$
${\displaystyle {\mathsf {sanserif\ text}}}$
$\displaystyle \mathnormal{normal\ text}$
${\displaystyle {\mathcal {CAL\ LETTERS}}}$
${\displaystyle \mathrm {\gamma } }$

Sizes

$\displaystyle \tiny tiny$
$\displaystyle \scriptsize scriptsize$
$\displaystyle \footnotesize footnotesize$
$\displaystyle \small small$
$\displaystyle \normalsize normalsize$
$\displaystyle \large large$
$\displaystyle \Large Large$
$\displaystyle \LARGE LARGE$
$\displaystyle \huge huge$
$\displaystyle \Huge Huge$