Formula examples

From DIYWiki
Jump to navigation Jump to search

Examples of how to use mathematical expressions, and formula in this wiki.

NOTE To use the math markup shown here directly, you need to be in "Edit Source" mode. If you are editing in the Visual Editor (the default), then use the Insert option on the toolbar, and select "More", then "Math Formula".

Chemical Equations


<ce>\mathit{A} ->[\ce{+H2O}] \mathit{B}</ce>

<ce>{SO4^{2-}} + Ba^2+ -> BaSO4 v</ce>

<math chem>A \ce{->[\ce{+H2O}]} B</math>












Quadratic Polynomial

<math>ax^2 + bx + c = 0</math>

Quadratic Polynomial (Force PNG Rendering)

<math>ax^2 + bx + c = 0\,</math>

Quadratic Formula


Tall Parentheses and Fractions

<math>2 = \left(
 \frac{\left(3-x\right) \times 2}{3-x}

 <math>S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}</math>


<math>\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds
 = \int_a^x f(y)(x-y)\,dy</math>



Differential Equation

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

Complex numbers

<math>|\bar{z}| = |z|,
 |(\bar{z})^n| = |z|^n,
 \arg(z^n) = n \arg(z)</math>


<math>\lim_{z\rightarrow z_0} f(z)=f(z_0)</math>

Integral Equation

<math>\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</math>


<math>\phi_n(\kappa) = 

Continuation and cases

 f(x) =
 1 & -1 \le x < 0 \\
 \frac{1}{2} & x = 0 \\
 1 - x^2 & \mbox{otherwise}

Prefixed subscript

 = \sum_{n=0}^\infty

Fraction and small fraction

<math> \frac {a}{b}\  \tfrac {a}{b} </math>

Alternate layout for expressions using math Template

This layout renders simpler expressions using HTML rather than the full blown rendering of the <math> tag. E.g:

xn + yn = 1
{{math|1=''x''<sup>''n''</sup> + ''y''<sup>''n''</sup> {{=}} 1}}