Function names such as sin and log are printed upright, so they never read as letters multiplied together. This lesson covers the names LaTeX knows, how to make your own, and every common way to write a derivative.
Function names
In maths mode, sin x gives : three italic variables times x. The command \sin x gives , upright and correctly spaced. Compare them:
LaTeX knows the usual names:
- Trigonometry:
\sin,\cos,\tan,\sec,\csc,\cot, and\arcsin,\arccos,\arctan. - Hyperbolic:
\sinh,\cosh,\tanh. - Logs and exponentials:
\log,\ln,\exp. - Others:
\lim,\max,\min,\sup,\inf,\det,\gcd.
Powers, bases and brackets
A power on a function name goes straight after it: \sin^2 x gives . A base goes in a subscript: \log_2 x gives . Brackets are typed as usual: \ln(x + 1).
Names LaTeX does not know
For a function without a command, use \operatorname{...}: \operatorname{sgn}(x) gives , upright and spaced like \sin.
Primes
An apostrophe gives a prime: f'(x) gives and f''(x) gives . For the nth derivative, put the order in brackets in a power: f^{(n)}(x) gives .
Leibniz notation
A derivative written as a fraction is just \frac:
A second derivative puts the 2 on the d at the top and on the x at the bottom: \frac{d^2 y}{dx^2} gives . Some books print the d upright: \frac{\mathrm{d}y}{\mathrm{d}x}. Either is fine; use one style throughout.
Partial derivatives
\partial gives :
\nabla gives , for the gradient: \nabla f.
Dots for time derivatives
In mechanics a dot over a letter means its rate of change: \dot{x} gives , and \ddot{x} gives .
Practise
A power on
\singoes straight after it:\sin^2 x.\sin^2 x + \cos^2 x = 1\lnprints ln upright.\ln(e^x) = xThe base of a log is a subscript.
\log_2 32 = 5The order in brackets, as a power:
f^{(n)}.f^{(n)}(x)\frac{d}{dx}, then the function.\frac{d}{dx} \sin x = \cos xd^2 yon top,dx^2underneath.\frac{d^2 y}{dx^2} + y = 0\partial^2 fon top,\partial x \, \partial yunderneath.\frac{\partial^2 f}{\partial x \, \partial y}\operatorname{...}for a name LaTeX does not know.\operatorname{sgn}(x)\ddot{x}puts two dots over the x.\ddot{x} = -\omega^2 x
In short
- Function names are commands:
\sin x, neversin x.\operatorname{...}for any other name. - Primes are apostrophes;
f^{(n)}for the nth derivative. - Leibniz notation is
\frac{dy}{dx};\partialand\nablafor partial derivatives and gradients;\dot{x}and\ddot{x}for time derivatives.
Next, in lesson 8: bold vectors, number sets and maths fonts.