Showing posts with label Mathematics in LaTeX. Show all posts
Showing posts with label Mathematics in LaTeX. Show all posts

Tuesday, October 1, 2019

Mathematics in LaTeX

Mathematical Expressions
In LaTex we have two modes to use mathematical expressions (inline and display mode)

For inline mode use any one of these delimiters.
1.  \( \)
2.  $ $
3.  \begin{math} \end{math}

Ex.
$c=a+b$

In displayed mode we have two versions (numbered and unnumbered)

We can use  any one of these delimiters in display mode
1. \[ \]
2. $$ $$
3. \begin{displaymath} \end{displaymath}
4. \begin{equation} \end{equation}

Ex.
$$ c=a+b $$

Note: include package amsmath
\usepackage{amsmath}

In Latex we can use the symbols ^  for superscripts and symbols  _ for subscripts.

Ex. 
\documentclass[options]{article}
\usepackage{amsmath}
\begin{document}

$$ x_1^2 + x_2^2 = x_3^2 $$

$$ x^{a \beta} - 1 = y_{ijk} + y_{lm}  $$

$$ ((xa)^n)^{p+q} = xa^{\theta}  $$

\[ \int\limits_0^\infty a^2 + b^2 \ dx \]

$$ \sum_{i=0}^{\infty} \frac{2}{n^s}
= \prod_p ^ n \frac{i}{1 - p^{-s}} $$

\end{document}

Output

Label in equation
We can use label for future reference
\documentclass[options]{article}
\usepackage{amsmath}
\begin{document}
\begin{equation} \label{eq01}
e^{\pi i} + 1 = 0
\end{equation}
The is an example of equation in \ref{eq01} Label
\end{document}

OUTPUT
Multiline Equation
use \begin{multline} command for numbered equation and \begin{multline*} for unnumbered equation.

\documentclass[options]{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
f(x) = 4x^6 + 4x^5y + 59x^4y^2 + 9x^3y^3\\
- 12x^91y^4 - 2xy^5 + 21y^6 - a^3b^3
\end{multline*}

\begin{multline}
f(x) = 4x^6 + 4x^5y + 5x^4y^2 + 9x^3y^3\\
- 12x^91y^4 - 2xy^5 + 21y^6 - a^3b^3
\end{multline}
\end{document}

Output