Formula examples: Difference between revisions

From DIYWiki
Jump to navigation Jump to search
m WIP
m Add note
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Examples of how to use mathematical expressions, and formula in this wiki. 


=== Chemistry ===
'''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 ===
  <nowiki><ce>C6H5-CHO</ce></nowiki>
  <nowiki><ce>C6H5-CHO</ce></nowiki>
  <ce>C6H5-CHO</ce>
  <ce>C6H5-CHO</ce>
Line 145: Line 150:
  <nowiki><math> \frac {a}{b}\  \tfrac {a}{b} </math></nowiki>
  <nowiki><math> \frac {a}{b}\  \tfrac {a}{b} </math></nowiki>


===Alternate Template layout===
===Alternate layout for expressions using math Template===
{{math|1=''x''<sup>''n''</sup> + ''y''<sup>''n''</sup> {{=}} 1}}
This layout renders simpler expressions using HTML rather than the full blown rendering of the <nowiki><math></nowiki> tag. E.g:
 
{{math|1=''x''<sup>''n''</sup> + ''y''<sup>''n''</sup> {{=}} 1}}
<nowiki>{{math|1=''x''<sup>''n''</sup> + ''y''<sup>''n''</sup> {{=}} 1}}</nowiki>

Latest revision as of 11:27, 29 March 2022

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>C6H5-CHO</ce>
CA6HA5CHO
<ce>\mathit{A} ->[\ce{+H2O}] \mathit{B}</ce>
A+HA2OB
<ce>{SO4^{2-}} + Ba^2+ -> BaSO4 v</ce>
SO42-+BaA2+BaSOA4
<math chem>A \ce{->[\ce{+H2O}]} B</math>
A+HA2OB
<ce>H2O</ce>
HA2O
<ce>Sb2O3</ce>
SbA2OA3
<ce>H+</ce>
HA+
<ce>CrO4^2-</ce>
CrOA4A2
<ce>AgCl2-</ce>
AgClA2A
<ce>[AgCl2]-</ce>
[AgClA2]A
<ce>Y^{99}+</ce>
YA99+
<ce>Y^{99+}</ce>
YA99+
<ce>H2_{(aq)}</ce>
HA2A(aq)
<ce>NO3-</ce>
NOA3A
<ce>(NH4)2S</ce>
(NHA4)A2S

Quadratic Polynomial

ax2+bx+c=0

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

Quadratic Polynomial (Force PNG Rendering)

ax2+bx+c=0

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

Quadratic Formula

x=b±b24ac2a

<math>x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}</math>

Tall Parentheses and Fractions

2=((3x)×23x)

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

Snew=Sold(5T)22

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

Integrals

axasf(y)dyds=axf(y)(xy)dy

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

Summation

m=1n=1m2n3m(m3n+n3m)

<math>\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}
 {3^m\left(m\,3^n+n\,3^m\right)}</math>

Differential Equation

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

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

Complex numbers

|z¯|=|z|,|(z¯)n|=|z|n,arg(zn)=narg(z)

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

Limits

limzz0f(z)=f(z0)

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

Integral Equation

ϕn(κ)=14π2κ20sin(κR)κRR[R2Dn(R)R]dR

<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>

Example

ϕn(κ)=0.033Cn2κ11/3,1L0κ1l0

<math>\phi_n(\kappa) = 
 0.033C_n^2\kappa^{-11/3},\quad
 \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}</math>

Continuation and cases

f(x)={11x<012x=01x2otherwise

<math>
 f(x) =
 \begin{cases}
 1 & -1 \le x < 0 \\
 \frac{1}{2} & x = 0 \\
 1 - x^2 & \mbox{otherwise}
 \end{cases}
 </math>

Prefixed subscript

pFq(a1,,ap;c1,,cq;z)=n=0(a1)n(ap)n(c1)n(cq)nznn!

 <math>{}_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!}</math>

Fraction and small fraction

abab
<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}}