Help:Math

From Open Energy Information

This page explains the Math syntax that can be used in order to format mathematical equations or chemical equations. For example:

 {{x^{12}+x+5}\over{x^{y/z}}}=2

Syntax

The syntax for displaying a formula is:

<math>{equation}</math>

Where "equation" is replaced by the wanted equation.

Equation Formatting

Description You type You get
Exponent
<math>x^2</math>
x^2
Exponent Grouping
<math>x^{21+y}</math>
x^{21+y}
Subscript
<math>CO_2</math>
CO_2
Subscript Grouping
<math>a_{i,j}</math>
a_{i,j}
Fraction
<math>1\over2</math>
<math>\frac{x}{y}=z</math>
1\over2

\frac{x}{y}=z

Fraction Grouping
<math>{x+y}\over{2(x-y)}</math>
{x+y}\over{2(x-y)}
Square Root
<math>\sqrt{2}</math>
\sqrt{2}
Log
<math>\exp_a b = a^b, \exp b = e^b, 10^m</math>
<math>\ln c, \lg d = \log e, \log_{10} f</math>

\exp_a b = a^b, \exp b = e^b, 10^m

\ln c, \lg d = \log e, \log_{10} f

Trig
<math>\sin a, \cos b, \tan c, \cot d, \sec e, \csc f</math>
<math>\arcsin h, \arccos i, \arctan j</math>

\sin a, \cos b, \tan c, \cot d, \sec e, \csc f

\arcsin h, \arccos i, \arctan j

Derivative
<math>\operatorname{d}y/\operatorname{d}x
{\operatorname{d}y\over\operatorname{d}x}
{\partial^2\over\partial x_1\partial x_2}y</math>
\operatorname{d}y/\operatorname{d}x, {\operatorname{d}y\over\operatorname{d}x}, {\partial^2\over\partial x_1\partial x_2}y
Integral
<math>\int\limits_{1}^{3} x \, dx</math>
\int\limits_{1}^{3} x \, dx
Double Integral
<math>\iint\limits_{1}^{3} x \, dx</math>
\iint\limits_{1}^{3} x \, dx

Symbols

Description You type You get
Operators
<math>+, -, \pm, \mp, \dotplus </math>
<math>\times, \div, \divideontimes, /, \backslash</math>
<math>\cdot, * \ast, \star, \circ, \bullet</math>

+, -, \pm, \mp, \dotplus

\times, \div, \divideontimes, /, \backslash

\cdot, * \ast, \star, \circ, \bullet

Relations
<math>=, \ne \neq, \equiv, \not\equiv</math>
<math>\doteq, \overset{\underset{\mathrm{def}}{}}{=}, :=</math>
<math>\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong</math>
<math><, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot</math>
<math>>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot</math>
<math>\le \leq, \lneq, \leqq, \nleqq, \lneqq, \lvertneqq</math>
<math>\ge \geq, \gneq, \geqq, \ngeqq, \gneqq, \gvertneqq</math>

=, \ne \neq, \equiv, \not\equiv

\doteq, \overset{\underset{\mathrm{def}}{}}{=}, :=

\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong

<, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot

>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot

\le \leq, \lneq, \leqq, \nleqq, \lneqq, \lvertneqq

\ge \geq, \gneq, \geqq, \ngeqq, \gneqq, \gvertneqq

Greek
<math>\alpha</math>

Where alpha can be replaced by:

alpha, beta, gamma, delta, epsilon, zeta, eta, theta, iota, kappa, lambda, mu, nu, xi, omicron, pi, rho, sigma, tau, upsilon, phi, chi, psi, omega, Gamma, Delta, Theta, Lambda, Xi, Pi, Sigma, Phi ,Psi, Omega
\alpha , \beta , \gamma , \delta , \epsilon , \zeta , \eta , \theta , \iota , \kappa , \lambda , \mu , \nu , \xi , \omicron , \pi , \rho , \sigma , \tau , \upsilon , \phi , \chi , \psi , \omega , \Gamma , \Delta , \Theta , \Lambda , \Xi , \Pi , \Sigma , \Phi , \Psi , \Omega
Arrows
<math>\Rightarrow</math>

Where "Rightarrow" can be replaced by:

  • Rightarrow, nRightarrow, Leftarrow, nLeftarrow, Leftrightarrow, nLeftrightarrow, Uparrow, Downarrow, Updownarrow
  • rightarrow \to, nrightarrow, longrightarrow, leftarrow \gets, nleftarrow, longleftarrow, leftrightarrow, nleftrightarrow, longleftrightarrow
  • rightharpoonup, rightharpoondown, leftharpoonup, leftharpoondown, upharpoonleft, upharpoonright, downharpoonleft, downharpoonright, rightleftharpoons, leftrightharpoons

\Rightarrow, \nRightarrow , \Leftarrow, \nLeftarrow , \Leftrightarrow, \nLeftrightarrow , \Uparrow, \Downarrow, \Updownarrow

 \rightarrow \to, \nrightarrow, \longrightarrow , \leftarrow \gets, \nleftarrow, \longleftarrow , \leftrightarrow, \nleftrightarrow, \longleftrightarrow

 \rightharpoonup , \rightharpoondown , \leftharpoonup , \leftharpoondown , \upharpoonleft , \upharpoonright \downharpoonleft , \downharpoonright , \rightleftharpoons , \leftrightharpoons

Examples

Reactions
<math> CH_4 + \frac{2}{\Phi} (O_2 + 3.76N_2) \Rightarrow CO_2 + 2H_2O + \frac{2}{\Phi} 3.76 N_2</math>

 CH_4 + \frac{2}{\Phi} (O_2 + 3.76N_2) \Rightarrow CO_2 + 2H_2O + \frac{2}{\Phi} 3.76 N_2

Equations
<math>x^{\alpha} + x^{\beta} + x^{\gamma + 2 \zeta} + x =5</math>

x^{\alpha} + x^{\beta} + x^{\gamma + 2 \zeta} + x =5

Differential Equations
<math>u'' + p(x)u' + q(x)u=f(x),\quad x>a</math>

u'' + p(x)u' + q(x)u=f(x),\quad x>a

Color
<math>{\color{Blue}x^2}+{\color{YellowOrange}2x}-{\color{OliveGreen}1}</math>

{\color{Blue}x^2}+{\color{YellowOrange}2x}-{\color{OliveGreen}1}

Additional Info

Wikipedia Help: Displaying a Formula