by

Mathematical & Chemical API Integration

December 23, 2018 in Uncategorized

Math Equations on all webpages are now functional thanks to Prof. Horstmann's Math API integration

Beautiful Math Equations in all browsers

MathML Integral Formula

f ( a ) = 1 2 π i γ f ( z ) z a d z

or Tex base ... Integral Formula

\begin{align} f(a) = \frac{1}{2\pi i} \oint_{\gamma}\frac{f(z)}{z-a}dz \end{align}

Dynamic Equations - step by step

Expand the following:

\begin{align} (x+1)^2 &\cssId{Step1}{= (x+1)(x+1)}\\ &\cssId{Step2}{= x(x+1) + 1(x+1)}\\ &\cssId{Step3}{= (x^2+x) + (x+1)}\\ &\cssId{Step4}{= x^2 + (x + x) + 1}\\ &\cssId{Step5}{= x^2+2x+1}\\ \end{align}

The Quadratic Formula

\begin{align} When $a \ne 0$, there are two solutions to $ax^2 bx c = 0$ and they are \end{align}

\begin{align} x = {-b \pm \sqrt{b^2-4ac} \over 2a}. \end{align}

Double angle formula for Cosines

\begin{align} \cos(θ+φ)=\cos(θ)\cos(φ)−\sin(θ)\sin(φ) \end{align}

Gauss' Divergence Theorem

\begin{align} \int_D ({\nabla\cdot} F)dV=\int_{\partial D} F\cdot ndS \end{align}

Curl of a Vector Field

\begin{align} \vec{\nabla} \times \vec{F} = \left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i} + \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j} + \left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k} \end{align}

Standard Deviation

\begin{align} \sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i -\mu)^2} \end{align}

Definition of Christoffel Symbols

\begin{align} (\nabla_X Y)^k = X^i (\nabla_i Y)^k = X^i \left( \frac{\partial Y^k}{\partial x^i} + \Gamma_{im}^k Y^m \right) \end{align}

The Lorenz Equations

\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z xy \end{align}

Cauchy's Integral Formula

\begin{align} f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz \end{align}

The Cauchy-Schwarz Inequality

\[ \left( \sum_{k=1}^n a_k b_k \right)^{\!\!2} \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \]

A Cross Product Formula

\[ \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\ \end{vmatrix} \]

The probability of getting \(k\) heads when flipping \(n\) coins is:

\[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]

An Identity of Ramanujan

\[ \frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} = 1 \frac{e^{-2\pi}} {1 \frac{e^{-4\pi}} {1 \frac{e^{-6\pi}} {1 \frac{e^{-8\pi}} {1 \ldots} } } } \]

A Rogers-Ramanujan Identity

\[ 1 \frac{q^2}{(1-q)} \frac{q^6}{(1-q)(1-q^2)} \cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j 2})(1-q^{5j 3})}, \quad\quad \text{for $|q|<1$}. \]

Maxwell's Equations

\begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, \, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{align}

In-line Mathematics

Finally, while display equations look good for a page of samples, the ability to mix math and text in a paragraph is also important. This expression \(\sqrt{3x-1} (1 x)^2\) is an example of an inline equation. As you see, equations can be used this way as well, without unduly disturbing the spacing between lines.

Trig Identity Formulas

Use these fundemental formulas of trigonometry to help solve problems by re-writing expressions in another equivalent form.

Basic Identities

\[\sin(x)=\frac{1}{\csc(x)}\]

\[\cos(x)=\frac{1}{\sec(x)}\]

\[\tan(x)=\frac{1}{\cot(x)}\]

\[\sec(x)=\frac{1}{\cos(x)}\]

\[\csc(x)=\frac{1}{\sin(x)}\]

\[\cot(x)=\frac{1}{\tan(x)}\]

\[\tan(x)=\frac{\sin(x)}{\cos(x)}\]

\[\sin(-x)=-\sin(x)\]

\[\cos(-x)=\cos(x)\]

\[\tan(-x)=-\tan(x)\]

Pythagorean Identities

\[\sin^2(x) \cos^2(x)=1\]

\[1 \tan^2(x)=\sec^2(x)\]

\[1 \cot^2(x)=\csc^2(x)\]

Sum and Difference Formulas

\[\sin(a b)=\sin(a)\cos(b) \cos(a)\sin(b)\]

\[\sin(a-b)=\sin(a)\cos(b)-\cos(a)\sin(b)\]

\[\cos(a b)=\cos(a)\cos(b)-\sin(a)\sin(b)\]

\[\cos(a-b)=\cos(a)\cos(b) \sin(a)\sin(b)\]

\[\tan(a b)=\frac{\tan(a) \tan(b)}{1-\tan(a)\tan(b)}\]

\[\tan(a-b)=\frac{\tan(a)-\tan(b)}{1 \tan(a)\tan(b)}\]

\[\sin(x) \sin(y)=2\sin(\frac{x y}{2})\cos(\frac{x-y}{2})\]

\[\sin(x)-\sin(y)=2\cos(\frac{x y}{2})\sin(\frac{x-y}{2})\]

\[\cos(x) \cos(y)=2\cos(\frac{x y}{2})\cos(\frac{x-y}{2})\]

\[\cos(x)-\cos(y)=-2\sin(\frac{x y}{2})\sin(\frac{x-y}{2})\]

Double Angle Formulas

\[\sin(2x)=2\sin(x)\cos(x)\]

\[\cos(2x)=\cos^2(x)-\sin^2(x)=1-2\sin^2(x) = 2\cos^2(x)-1\]

Half Angle Formulas

\[\sin(\frac{x}{2})=\pm\sqrt{\frac{1-\cos(x)}{2}}\]

\[\cos(\frac{x}{2})=\pm\sqrt{\frac{1 \cos(x)}{2}}\]

\[\tan(\frac{x}{2})=\pm\sqrt{\frac{1-\cos(x)}{1 \cos(x)}}=\frac{1-\cos(x)}{\sin(x)}=\frac{\sin(x)}{1 \cos(x)}\]

Trigonometric Products

\[\sin(x)\cos(y)=\frac{\sin(x y) \sin(x-y)}{2}\]

\[\cos(x)\cos(y)=\frac{\cos(x y) \cos(x-y)}{2}\]

\[\sin(x)\sin(y)=\frac{\cos(x-y)-\cos(x y)}{2}\]

Chemical Equations on all webpages are now functional thanks to Prof. Horstmann's Chemical API integration

Beautiful Chemical Equations in all browsers

$$\ce{Zn^2 <=>[ 2OH-][ 2H ] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$$ <=>[ 2OH-][ 2H ] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$$}$$

Organic chemistry molecule ...

$$\ce{CH3\bond{1}} {\stackrel{ \;\;\;\large\ce{CH3} }{\stackrel{|}{\underset{\underset{\huge\ce{Cl}}{|}}{\ce{C}}}}}\ce{-CH3}$$

Chemical Equations (ce) ...

$$\ce{CO2 C -> 2 CO}$$

$$\ce{Hg^2 ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$

$$C_p[\ce{H2O(l)}] = \pu{75.3 J // mol K}$$

Chemical Formulae

$$\ce{H2O}$$ $$\ce{Sb2O3}$$

Charges

$$\ce{H }$$ $$\ce{CrO4^2-}$$ $$\ce{[AgCl2]-}$$

$$\ce{Y^99 }$$ $$\ce{Y^{99 }}$$

Stoichiometric Numbers

$$\ce{2 H2O}$$ $$\ce{2H2O}$$ $$\ce{0.5 H2O}$$

$$\ce{1/2 H2O}$$ $$\ce{(1/2) H2O}$$ $$\ce{$n$ H2O}$$

Isotopes

$$\ce{^{227}_{90}Th }$$ $$\ce{^227_90Th }$$ $$\ce{^{0}_{-1}n^{-}}$$ $$\ce{^0_-1n-}$$ $$\ce{H{}^3HO}$$ $$\ce{H^3HO}$$

Reaction Arrows

$$\ce{A -> B}$$     $$\ce{A <- B}$$     $$\ce{A <-> B}$$     $$\ce{A <--> B}$$     $$\ce{A <=> B}$$     $$\ce{A <=>> B}$$     $$\ce{A <<=> B}$$     $$\ce{A ->[H2O] B}$$     $$\ce{A ->[{text above}][{text below}] B}$$     $$\ce{A ->[$x$][$x_i$] B}$$

Parentheses, Brackets, Braces

$$\ce{(NH4)2S}$$ $$\ce{[\{(X2)3\}2]^3 }$$ $$\ce{CH4 2 $\left( \ce{O2 79/21 N2} \right)$}$$

States of Aggregation

$$\ce{H2(aq)}$$ $$\ce{CO3^2-_{(aq)}}$$ $$\ce{NaOH(aq,$\infty$)}$$

Crystal Systems

$$\ce{ZnS($c$)}$$ $$\ce{ZnS(\ca$c$)}$$

Variables like x, n, 2n 1

$$\ce{NO_x}$$ $$\ce{Fe^n }$$ $$\ce{x Na(NH4)HPO4 ->[\Delta] (NaPO3)_x x NH3 ^ x H2O}$$

Greek Characters

$$\ce{\mu-Cl}$$ $$\ce{[Pt(\eta^2-C2H4)Cl3]-}$$ $$\ce{\beta }$$ $$\ce{^40_18Ar \gamma{} \nu_e}$$

(Italic) Math

$$\ce{NaOH(aq,$\infty$)}$$ $$\ce{Fe(CN)_{$\frac{6}{2}$$}}$$ $$\ce{X_{$i$}^{$x$}}$$ $$\ce{X_$i$^$x$}$$

Italic Text

$$\ce{$cis${-}[PtCl2(NH3)2]}$$ $$\ce{CuS($hP12$)}$$

Upright Text, Escape Parsing

$$\ce{{Gluconic Acid} H2O2}$$ $$\ce{X_{{red}}}$$ $$\ce{{( )}_589{-}[Co(en)3]Cl3}$$

Bonds

$$\ce{C6H5-CHO}$$ $$\ce{A-B=C#D}$$ $$\ce{A\bond{-}B\bond{=}C\bond{#}D}$$ $$\ce{A\bond{1}B\bond{2}C\bond{3}D}$$ $$\ce{A\bond{~}B\bond{~-}C}$$ $$\ce{A\bond{~--}B\bond{~=}C\bond{-~-}D}$$ $$\ce{A\bond{...}B\bond{....}C}$$ $$\ce{A\bond{->}B\bond{<-}C}$$

Addition Compounds

$$\ce{KCr(SO4)2*12H2O}$$ $$\ce{KCr(SO4)2.12H2O}$$ $$\ce{KCr(SO4)2 * 12 H2O}$$

Oxidation States

$$\ce{Fe^{II}Fe^{III}2O4}$$

Unpaired Electrons, Radical Dots

$$\ce{OCO^{.-}}$$ $$\ce{NO^{(2.)-}}$$

Kröger-Vink Notation

$$\ce{Li^x_{Li,1-2x}Mg^._{Li,x}$$V'_{Li,x}Cl^x_{Cl}}$$ $$\ce{O''_{i,x}}$$ $$\ce{M^{..}_i}$$ $$\ce{$V$^{4'}_{Ti}}$$ $$\ce{V_{V,1}C_{C,0.8}$$V_{C,0.2}}$$

Equation Operators

$$\ce{A B}$$ $$\ce{A - B}$$ $$\ce{A = B}$$ $$\ce{A \pm B}$$

Precipitate and Gas

$$\ce{SO4^2- Ba^2 -> BaSO4 v}$$ $$\ce{A v B (v) -> B ^ B (^)}$$

Other Symbols and Shortcuts

$$\ce{NO^*}$$ $$\ce{1s^2-N}$$ $$\ce{n-Pr}$$ $$\ce{iPr}$$ $$\ce{\ca Fe}$$ $$\ce{A, B, C; F}$$ $$\ce{{and others}}$$

Complex Examples

$$\ce{Zn^2 <=>[ 2OH-][ 2H ] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$$ <=>[ 2OH-][ 2H ] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$$}$$ $$K = \frac{[\ce{Hg^2 }][\ce{Hg}]}{[\ce{Hg2^2 }]}$$ $$K = \ce{\frac{[Hg^2 ][Hg]}{[Hg2^2 ]}}$$ $$\ce{Hg^2 ->[I-] $\underset{\mathrm{red}}{\ce{HgI2}}$$ ->[I-] $\underset{\mathrm{red}}{\ce{[Hg^{II}I4]^2-}}$$}$$

Physical Units (pu)

$$\pu{123 kJ}$$ $$\pu{123 mm2}$$ $$\pu{123 J s}$$ $$\pu{123 J*s}$$ $$\pu{123 kJ/mol}$$ $$\pu{123 kJ//mol}$$ $$\pu{123 kJ mol-1}$$ $$\pu{123 kJ*mol-1}$$ $$\pu{1.2e3 kJ}$$ $$\pu{1,2e3 kJ}$$ $$\pu{1.2E3 kJ}$$ $$\pu{1,2E3 kJ}$$

Crystal Systems

$$\ce{ZnS($c$)}$$ $$\ce{ZnS(\ca$c$)}$$

In-line Chemical Equations

Finally, while display equations look good for a page of samples, the ability to mix Chemical Equations and text in a paragraph is also important. This expression \(\ce{Zn^2 <=>[ 2OH-][ 2H ] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$$ <=>[ 2OH-][ 2H ] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$$}\) is an example of an inline equation. As you see, equations can be used this way as well, without unduly disturbing the spacing between lines.

Comments are closed.