equation latex code example

Example 1: latex pmatrix

Trying to typeset an inline matrix here
$\begin{pmatrix}
  a & b\\ 
  c & d
\end{pmatrix}$ 
but it looks too big, so let's try 
$\big(\begin{smallmatrix}
  a & b\\
  c & d
\end{smallmatrix}\big)$ 
instead.

Example 2: integral latex

integral 
\[ \int_{a}^{b} x^2 \,dx \]

Example 3: equation latex

The mass-energy equivalence is described by the famous equation

\[E=mc^2\]

discovered in 1905 by Albert Einstein. 
In natural units ($c$ = 1), the formula expresses the identity

\begin{equation}
E=m
\end{equation}