Exponential function in LaTeX
The exponential function raises Euler's number e to a power; in LaTeX write e^{x}, or \exp(x), which sets exp upright like \sin and \log.
Main page: Logarithms and exponentials in LaTeX →
LaTeX command
e^{x}Not the symbol you meant? Draw it to find the command →
Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →
For short exponents, e^{x} is the natural choice: the caret raises everything inside the braces, so e^{2x+1} keeps the whole exponent up. Without braces only the next character is raised, so e^2x prints e squared times x, a common slip when converting handwritten notes.
When the exponent is long or holds a fraction, a superscript shrinks it until it is hard to read. \exp keeps it on the main line: is far clearer than the same thing raised as a superscript. \exp is an operator like \log and \sin, so it is set upright with the right spacing; typing plain exp gives three italic letters that read as a product.
Style guides differ on the letter e itself. Most maths writing uses an italic e, while ISO 80000-2, common in physics and engineering, asks for an upright e because it is a constant, not a variable. If you use the upright form, define it once so the whole document stays consistent.
An upright e for the whole document
Define a short command in the preamble and use it everywhere you mean the constant. Changing your mind later is then a one-line edit: point the command back at a plain e.
\newcommand{\eu}{\mathrm{e}}$\eu^{i\pi} = -1$Other forms
\exp(x)exp as an upright operator\mathrm{e}^{x}an upright e (ISO style)e^{-x^2/2}the whole exponent in bracesExamples
$e^{x}$e to the power x
$e^{i\pi} + 1 = 0$Euler's identity
$\frac{d}{dx} e^{x} = e^{x}$the exponential is its own derivative
$\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)$a long exponent kept on the line with \exp
$e^{x} = \sum_{n=0}^{\infty} \frac{x^n}{n!}$the power series
$\mathrm{e}^{-t/\tau}$an upright e, as ISO style asks, in exponential decay
Tips and common mistakes
- Always brace the exponent: e^{-2t} raises -2t, while e^-2t raises only the minus sign.
- Write
\exp, not exp: the command sets it upright as a function name, while plain letters come out as the italic product of e, x and p. - Switch to
\expwhen the exponent holds a fraction, a sum or anything taller than a letter or two. - Use
\left( and\right) with\expso the brackets grow with a fraction inside. - Pick italic e or upright
\mathrm{e}once and keep it the same throughout the document.
Working from handwritten notes?
LatexNotes turns a photo or PDF of handwritten mathematics into LaTeX, graphs and all. It is built with real pdflatex before you see it, and the .tex file is yours to edit or take to Overleaf. Free to try, no sign-up.
See how handwriting to LaTeX works, step by step, or go from GoodNotes to LaTeX if you write on an iPad (Notability works the same way).
Convert your maths to LaTeX →FAQ
How do I write e to the power of x in LaTeX?
Type e^{x} in maths mode, for example . Put the whole exponent inside the braces.
What is the difference between \exp and e^{x}?
They mean the same function. e^{x} sets the exponent as a superscript; \exp(x) writes it on the main line with an upright exp, which reads better for long exponents.
Does \exp need a package?
No. \exp is built into LaTeX, like \log and \sin, and KaTeX supports it too.
Should e be italic or upright?
Both are used. Most maths texts use an italic e; ISO 80000-2, common in physics and engineering, uses an upright \mathrm{e}. Choose one and use it consistently.