There are two ways to write math expressions:
Inline math: Use \(...\)
for expressions within text like \(x^2 + y^2 = r^2\)
Display math: Use \[...]\
for centered equations:
\[\sum_{i=1}^n i = \frac{n(n+1)}{2}\]
Type | LaTeX | Result |
---|---|---|
Fractions | \frac{a}{b} |
\(\frac{a}{b}\) |
Exponents | x^2 |
\(x^2\) |
Subscripts | x_n |
\(x_n\) |
Square root | \sqrt{x} |
\(\sqrt{x}\) |
nth root | \sqrt[n]{x} |
\(\sqrt[n]{x}\) |
\alpha |
\(\alpha\) | \beta |
\(\beta\) | \gamma |
\(\gamma\) |
\pi |
\(\pi\) | \theta |
\(\theta\) | \sigma |
\(\sigma\) |
Derivative | \frac{d}{dx} |
\(\frac{d}{dx}\) |
Integral | \int_a^b |
\(\int_a^b\) |
Limit | \lim_{x \to \infty} |
\(\lim_{x \to \infty}\) |
Example of a complex equation:
\[ f(x) = \int_0^\infty \frac{x^3}{e^x-1} dx = \frac{\pi^4}{15} \]
Renders as:
\[ f(x) = \int_0^\infty \frac{x^3}{e^x-1} dx = \frac{\pi^4}{15} \]