Help:Complete math help file

Please note that non standard characters will probably not render properly

The complete helpfile is over 50kB in size. Some browsers may have difficulty in rendering the page, because many have a notional upper limit of 32kB per page. Please choose from one of the following options to access the help file:

Related Math Help pages

 * Math Help part 1 - contains information on Syntax, Rendering and Pros and Cons of TeX and HTML for math functions


 * Math Help part 2 - contains information on Functions, Symbols and Special characters


 * Math Help part 3 - contains information on Subscripts, Superscripts and Integrals


 * Math Help part 4 - contains information on Fractions, Matrices and Multilines


 * Math Help part 5 - contains information on Alphabets and Typefaces


 * Math Help part 6 - contains information on Parenthesising big exprssions, Brackets and Bars


 * Math Help part 7 - contains information about Spacing, Aligning with normal text flow,Forced PNG rendering, Color and examples.

This wiki uses a subset of TeX markup, including some extensions from LaTeX and AMS-LaTeX, for mathematical formulae. It generates either PNG images or simple HTML markup, depending on user preferences and the complexity of the expression. In the future, as more browsers are smarter, it will be able to generate enhanced HTML or even MathML in many cases.

More precisely, MediaWiki filters the markup through Texvc, which in turn passes the commands to TeX for the actual rendering. Thus, only a limited part of the full TeX language is supported; see below for details.

Syntax
Math markup goes inside. The edit toolbar]] has a button for this.

Similarly to HTML, in TeX extra spaces and newlines are ignored.

The TeX code has to be put literally: MediaWiki templates, predefined templates, and parameters cannot be used within math tags: pairs of double braces are ignored and "#" gives an error message. However, math tags work in the then and else part of #if, etc.

Rendering
The PNG images are black on white (not transparent). These colors, as well as font sizes and types, are independent of browser settings or CSS. Font sizes and types will often deviate from what HTML renders. Vertical alignment with the surrounding text can also be a problem. The css selector of the images is img.tex.

It should be pointed out that most of these shortcomings have been addressed by Maynard Handley, but have not been released yet.

The  attribute of the PNG images (the text that is displayed if your browser can't display images; Internet Explorer shows it up in the hover box) is the wikitext that produced them, excluding the   and.

Apart from function and operator names, as is customary in mathematics for variables, letters are in italics; digits are not. For other text, (like variable labels) to avoid being rendered in italics like variables, use  or. For example,   gives $$\mbox{abc}$$.

TeX vs HTML
Before introducing TeX markup for producing special characters, it should be noted that, as this comparison table shows, sometimes similar results can be achieved in HTML Special characters.

The use of HTML instead of TeX is still under discussion. The arguments either way can be summarised as follows.

Pros of HTML

 * In-line HTML formulae always align properly with the rest of the HTML text.
 * The formula's background, font size and face match the rest of HTML contents and the appearance respects CSS and browser settings.
 * Pages using HTML will load faster.

Pros of TeX

 * TeX is semantically superior to HTML. In TeX, " " means "mathematical variable $$x$$", whereas in HTML " " could mean anything. Information has been irrevocably lost. This has multiple benefits:
 * TeX can be transformed into HTML, but not vice-versa. This means that on the server side we can always transform a formula, based on its complexity and location within the text, user preferences, type of browser, etc. Therefore, where possible, all the benefits of HTML can be retained, together with the benefits of TeX. It's true that the current situation is not ideal, but that's not a good reason to drop information/contents.
 * TeX can be converted to MathML for browsers which support it, thus keeping its semantics and allowing it to be rendered as a vector.
 * TeX has been specifically designed for typesetting formulae, so input is easier and more natural, and output is more aesthetically pleasing.
 * When writing in TeX, editors need not worry about browser support, since it is rendered into an image by the server. HTML formulae, on the other hand, can end up being rendered inconsistent of editor's intentions (or not at all), by some browsers or older versions of a browser.

Functions, symbols, special characters
{| class="wikitable" ! colspan="2" | Accents/Diacritics ! colspan="2" |
 * $$\acute{a} \grave{a} \hat{a} \tilde{a} \breve{a}\,\!$$
 * $$\check{a} \bar{a} \ddot{a} \dot{a}\,\!$$
 * $$\acute{a} \grave{a} \hat{a} \tilde{a} \breve{a}\,\!$$
 * $$\check{a} \bar{a} \ddot{a} \dot{a}\,\!$$
 * $$\check{a} \bar{a} \ddot{a} \dot{a}\,\!$$
 * $$\check{a} \bar{a} \ddot{a} \dot{a}\,\!$$

Standard functions ! colspan="2" | Modular arithmetic ! colspan="2" | Derivatives ! colspan="2" | Sets ! colspan="2" |
 * $$\sin a \cos b \tan c\,\!$$
 * $$\sec d \csc e \cot f\,\!$$
 * $$\arcsin h \arccos i \arctan j\,\!$$
 * $$\sinh k \cosh l \tanh m \coth n\,\!$$
 * $$\operatorname{sh}o \operatorname{ch}p \operatorname{th}q\,\!$$
 * $$\operatorname{argsh}r \operatorname{argch}s \operatorname{argth}t\,\!$$
 * $$\lim u \limsup v \liminf w \min x \max y\,\!$$
 * $$\inf z \sup a \exp b \ln c \lg d \log e \log_{10} f \ker g\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\sinh k \cosh l \tanh m \coth n\,\!$$
 * $$\operatorname{sh}o \operatorname{ch}p \operatorname{th}q\,\!$$
 * $$\operatorname{argsh}r \operatorname{argch}s \operatorname{argth}t\,\!$$
 * $$\lim u \limsup v \liminf w \min x \max y\,\!$$
 * $$\inf z \sup a \exp b \ln c \lg d \log e \log_{10} f \ker g\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\operatorname{argsh}r \operatorname{argch}s \operatorname{argth}t\,\!$$
 * $$\lim u \limsup v \liminf w \min x \max y\,\!$$
 * $$\inf z \sup a \exp b \ln c \lg d \log e \log_{10} f \ker g\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\lim u \limsup v \liminf w \min x \max y\,\!$$
 * $$\inf z \sup a \exp b \ln c \lg d \log e \log_{10} f \ker g\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\inf z \sup a \exp b \ln c \lg d \log e \log_{10} f \ker g\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$\deg h \gcd i \Pr j \det k \hom l \arg m \dim n\,\!$$
 * $$s_k \equiv 0 \pmod{m} a \bmod b\,\!$$
 * $$s_k \equiv 0 \pmod{m} a \bmod b\,\!$$
 * $$s_k \equiv 0 \pmod{m} a \bmod b\,\!$$
 * $$\nabla \partial x dx \dot x \ddot y\,\!$$
 * $$\nabla \partial x dx \dot x \ddot y\,\!$$
 * $$\nabla \partial x dx \dot x \ddot y\,\!$$
 * $$\forall \exists \empty \emptyset \varnothing\,\!$$
 * $$\in \ni \not \in \notin \subset \subseteq \subsetneq \supset \supseteq \supsetneq\,\!$$
 * $$\cap \bigcap \cup \bigcup \biguplus \setminus \smallsetminus\,\!$$
 * $$\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\,\!$$
 * $$\in \ni \not \in \notin \subset \subseteq \subsetneq \supset \supseteq \supsetneq\,\!$$
 * $$\cap \bigcap \cup \bigcup \biguplus \setminus \smallsetminus\,\!$$
 * $$\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\,\!$$
 * $$\cap \bigcap \cup \bigcup \biguplus \setminus \smallsetminus\,\!$$
 * $$\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\,\!$$
 * $$\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\,\!$$
 * $$\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\,\!$$
 * $$\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\,\!$$

Operators ! colspan="2" |
 * $$+ \oplus \bigoplus \pm \mp - \,\!$$
 * $$\times \otimes \bigotimes \cdot \circ \bullet \bigodot\,\!$$
 * $$+ \oplus \bigoplus \pm \mp - \,\!$$
 * $$\times \otimes \bigotimes \cdot \circ \bullet \bigodot\,\!$$
 * $$\times \otimes \bigotimes \cdot \circ \bullet \bigodot\,\!$$
 * $$\times \otimes \bigotimes \cdot \circ \bullet \bigodot\,\!$$

Logic ! colspan="2" |
 * $$\land \wedge \bigwedge \bar{q} \to p\,\!$$
 * $$\lor \vee \bigvee \lnot \neg q \And\,\!$$
 * $$\land \wedge \bigwedge \bar{q} \to p\,\!$$
 * $$\lor \vee \bigvee \lnot \neg q \And\,\!$$
 * $$\lor \vee \bigvee \lnot \neg q \And\,\!$$
 * $$\lor \vee \bigvee \lnot \neg q \And\,\!$$

Root
 * $$\sqrt{2} \sqrt[n]{x}\,\!$$
 * $$\sqrt{2} \sqrt[n]{x}\,\!$$
 * $$\sqrt{2} \sqrt[n]{x}\,\!$$

! colspan="2" |

Geometric ! colspan="2" |
 * $$\Diamond \, \Box \, \triangle \, \angle \perp \, \mid \; \nmid \, \| 45^\circ\,\!$$
 * $$\Diamond \, \Box \, \triangle \, \angle \perp \, \mid \; \nmid \, \| 45^\circ\,\!$$
 * $$\Diamond \, \Box \, \triangle \, \angle \perp \, \mid \; \nmid \, \| 45^\circ\,\!$$

Arrows
 * $$\leftarrow \gets \rightarrow \to \not\to \leftrightarrow \longleftarrow \longrightarrow\,\!$$
 * $$\mapsto \longmapsto \hookrightarrow \hookleftarrow \nearrow \searrow \swarrow \nwarrow\,\!$$
 * $$\uparrow \downarrow \updownarrow \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft\,\!$$
 * $$\mapsto \longmapsto \hookrightarrow \hookleftarrow \nearrow \searrow \swarrow \nwarrow\,\!$$
 * $$\uparrow \downarrow \updownarrow \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft\,\!$$
 * $$\mapsto \longmapsto \hookrightarrow \hookleftarrow \nearrow \searrow \swarrow \nwarrow\,\!$$
 * $$\uparrow \downarrow \updownarrow \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft\,\!$$
 * $$\uparrow \downarrow \updownarrow \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft\,\!$$
 * $$\uparrow \downarrow \updownarrow \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft\,\!$$

! colspan="2" | Special
 * $$\eth \S \P \% \dagger \ddagger \ldots \cdots\,\!$$
 * $$\smile \frown \wr \triangleleft \triangleright \infty \bot \top\,\!$$
 * $$\vdash \vDash \Vdash \models \lVert \rVert \imath \hbar\,\!$$
 * $$\ell \mho \Finv \Re \Im \wp \complement \diamondsuit\,\!$$
 * $$\heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp\,\!$$
 * $$\smile \frown \wr \triangleleft \triangleright \infty \bot \top\,\!$$
 * $$\vdash \vDash \Vdash \models \lVert \rVert \imath \hbar\,\!$$
 * $$\ell \mho \Finv \Re \Im \wp \complement \diamondsuit\,\!$$
 * $$\heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp\,\!$$
 * $$\ell \mho \Finv \Re \Im \wp \complement \diamondsuit\,\!$$
 * $$\heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp\,\!$$
 * $$\ell \mho \Finv \Re \Im \wp \complement \diamondsuit\,\!$$
 * $$\heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp\,\!$$
 * $$\heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp\,\!$$
 * $$\heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp\,\!$$

Fractions, matrices, multilines
$$\frac{2}{4}=0.5$$

Large (nestled) Fractions $$\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a$$

Matrices \begin{matrix} x & y \\ z & v \end{matrix} $$\begin{matrix} x & y \\ z & v \end{matrix}$$

\begin{vmatrix} x & y \\ z & v \end{vmatrix} $$\begin{vmatrix} x & y \\ z & v \end{vmatrix}$$

\begin{Vmatrix} x & y \\ z & v \end{Vmatrix} $$\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}$$

\begin{bmatrix} 0     & \cdots & 0      \\ \vdots & \ddots & \vdots \\ 0     & \cdots & 0 \end{bmatrix} $$\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} $$

\begin{Bmatrix} x & y \\ z & v \end{Bmatrix} $$\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}$$

\begin{pmatrix} x & y \\ z & v \end{pmatrix} $$\begin{pmatrix} x & y \\ z & v \end{pmatrix}$$

\bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr)

Case distinctions f(n) = \begin{cases} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{cases}

Breaking up a long expression so that it wraps when necessary $$f(x) \,\!$$ $$= \sum_{n=0}^\infty a_n x^n $$ $$= a_0+a_1x+a_2x^2+\cdots$$ $$f(x) \,\!$$$$= \sum_{n=0}^\infty a_n x^n $$$$= a_0 +a_1x+a_2x^2+\cdots$$

Simultaneous equations \begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases} $$\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}$$

Parenthesizing big expressions, brackets, bars
You can use various delimiters with \left and \right:

Spacing
Note that TeX handles most spacing automatically, but you may sometimes want manual control.

Align with normal text flow
Due to the default css

img.tex { vertical-align: middle; }

an inline expression like $$\int_{-N}^{N} e^x\, dx = 2 \sinh N$$ should look good.

If you need to align it otherwise, use  and play with the   argument until you get it right; however, how it looks may depend on the browser and the browser settings.

Also note that if you rely on this workaround, if/when the rendering on the server gets fixed in future releases, as a result of this extra manual offset your formulae will suddenly be aligned incorrectly. So use it sparingly, if at all.

Forced PNG rendering
To force the formula to render as PNG, add  (small space) at the end of the formula (where it is not rendered). This will force PNG if the user is in "HTML if simple" mode, but not for "HTML if possible" mode (math rendering settings in preferences.

You can also use  (small space and negative space, which cancel out) anywhere inside the math tags. This does force PNG even in "HTML if possible" mode, unlike.

This could be useful to keep the rendering of formulae in a proof consistent, for example, or to fix formulae that render incorrectly in HTML (at one time, a^{2+2} rendered with an extra underscore), or to demonstrate how something is rendered when it would normally show up as HTML (as in the examples above).

For instance:

This has been tested with most of the formulae on this page, and seems to work perfectly.

You might want to include a comment in the HTML so people don't "correct" the formula by removing it:



Quadratic Polynomial
$$ax^2 + bx + c = 0$$

$$ax^2 + bx + c = 0$$

Quadratic Polynomial (Force PNG Rendering)
$$ax^2 + bx + c = 0\,\!$$ $$ax^2 + bx + c = 0\,\!$$

Quadratic Formula
$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$ $$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

Tall Parentheses and Fractions
$$2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right)$$ $$2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right)$$

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

Integrals
$$\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
$$\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
$$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
$$|\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
$$\lim_{z\rightarrow z_0} f(z)=f(z_0)$$ $$\lim_{z\rightarrow z_0} f(z)=f(z_0)$$

Integral Equation
$$\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$$

Continuation and cases
$$f(x) = \begin{cases}1 & -1 \le x < 0 \\ \frac{1}{2} & x = 0 \\ 1 - x^2 & 0 < x \le 1\end{cases}$$ $$ f(x) = \begin{cases} 1 & -1 \le x < 0 \\ \frac{1}{2} & x = 0 \\ 1 - x^2 & 0 < x\le 1 \end{cases} $$

Prefixed subscript
$${}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z) = \sum_{n=0}^\infty \frac{(a_1)_n\cdot\cdot\cdot(a_p)_n}{(c_1)_n\cdot\cdot\cdot(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\cdot\cdot\cdot(a_p)_n}{(c_1)_n\cdot\cdot\cdot(c_q)_n} \frac{z^n}{n!}$$