Now that you know how Inline Math and Block Math work, it's time to learn the mathematical expressions you'll use most often.
Instead of memorizing every LaTeX command, focus on understanding the purpose of each one. Once you know when to use a particular expression, writing equations becomes much easier.
Writing Fractions
Fractions are one of the most common mathematical expressions.
Use the \frac command.
Syntax
$\frac{a}{b}$
Example
$\frac{3}{4}$
This represents three divided by four.
Another example:
$$
\frac{x+1}{y-2}
$$
Block Math makes larger fractions easier to read.
Common Uses
- Probability
- Algebra
- Statistics
- Scientific calculations
Writing Square Roots
Use the \sqrt command to display square roots.
Syntax
$\sqrt{x}$
Example
$\sqrt{25}=5$
You can also create more complex square roots.
$$
\sqrt{x^2+y^2}
$$
Square roots are frequently used in geometry, engineering, and physics.
Writing Powers
Superscripts are created with the caret (^).
Example
$x^2$
Produces:
Another example:
$5^3=125$
You can also group expressions.
$(x+y)^2$
This is useful when the exponent applies to more than one value.
Writing Subscripts
Subscripts use the underscore (_).
Example:
$x_1$
Another example:
$H_2O$
Subscripts are commonly used in:
- Chemistry
- Physics
- Mathematics
- Programming variables
Combining Superscripts and Subscripts
You can combine both together.
Example:
$x_1^2$
This displays the variable with both a subscript and a superscript.
It's commonly used when working with mathematical sequences and indexed variables.
Greek Letters
Many scientific formulas use Greek letters instead of the English alphabet.
Here are some of the most common ones.
| Symbol |
Markdown Math |
| α |
$\alpha$ |
| β |
$\beta$ |
| γ |
$\gamma$ |
| θ |
$\theta$ |
| λ |
$\lambda$ |
| π |
$\pi$ |
| σ |
$\sigma$ |
| Ω |
$\Omega$ |
Example:
$\alpha+\beta=\gamma$
Greek letters appear frequently in mathematics, statistics, engineering, and machine learning.
Mathematical Operators
Markdown Math supports many mathematical symbols.
| Operation |
Syntax |
| Addition |
$a+b$ |
| Subtraction |
$a-b$ |
| Multiplication |
$a \times b$ |
| Division |
$\frac{a}{b}$ |
| Less Than |
$a<b$ |
| Greater Than |
$a>b$ |
| Less Than or Equal |
$a\le b$ |
| Greater Than or Equal |
$a\ge b$ |
| Not Equal |
$a\ne b$ |
Example:
$a \times b = c$
Using proper mathematical operators makes formulas much easier to understand than plain text.
Writing Summations
Summations are commonly used in statistics and mathematics.
Use the \sum command.
Example:
$$
\sum_{i=1}^{n} i
$$
This means:
Add every value from 1 to n.
Summations are frequently used in:
- Statistics
- Algorithms
- Machine learning
- Data science
Writing Integrals
Integrals are widely used in calculus.
Example:
$$
\int x^2 dx
$$
Another example:
$$
\int_0^1 x\,dx
$$
Block Math is recommended for integrals because they are easier to read on their own line.
Writing Limits
Limits describe what happens as a value approaches another value.
Example:
$$
\lim_{x\to0}\frac{\sin x}{x}
$$
Limits are commonly used in:
- Calculus
- Engineering
- Physics
Using Brackets
Large mathematical expressions often require scalable brackets.
Example:
$$
\left(\frac{a+b}{c+d}\right)
$$
The \left and \right commands automatically adjust the bracket size to match the equation.
This improves readability, especially for nested expressions.
Writing Matrices
Matrices are common in linear algebra, computer graphics, and machine learning.
Example:
$$
\begin{bmatrix}
1 & 2 \\
3 & 4
\end{bmatrix}
$$
This creates a 2 × 2 matrix.
Using Block Math keeps matrices properly aligned and much easier to read.
A Complete Example
Here's a simple mathematical note that combines several concepts you've learned.
# Algebra Notes
The quadratic formula is:
$$
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
$$
The variable $x$ represents the unknown value.
The discriminant is $b^2-4ac$.
When $\Delta>0$, there are two real solutions.
This example demonstrates how Inline Math and Block Math work together in a real Markdown document. See Markdown Code Blocks for fenced blocks and syntax highlighting.