All guides

Trigonometric functions in LaTeX

Updated:

Write function names with \sin, \cos and \tan. They are set upright with the right spacing before the argument. For a function that has no built-in command, such as sgn or arcsinh in older setups, use \operatorname.

Pythagorean identity

\sin^2 \alpha + \cos^2 \alpha = 1
sin⁡2α+cos⁡2α=1\sin^2 \alpha + \cos^2 \alpha = 1

The power goes straight after the function name: \sin^2 \alpha. This is the standard way to write the square of the sine and it needs no extra brackets.

Copying this from handwritten notes? Snap a photo of the page and CamteX turns the formulas into LaTeX. Try it free

Tangent and a custom operator

\tan x = \frac{\sin x}{\cos x}, \quad \operatorname{sgn} x
tan⁡x=sin⁡xcos⁡x,sgn⁡x\tan x = \frac{\sin x}{\cos x}, \quad \operatorname{sgn} x

\operatorname gives any name the same upright font and spacing as \sin. In a longer document declare it once in the preamble with \DeclareMathOperator{\sgn}{sgn}.

Inverse function

\arcsin x, \quad \sin^{-1} x
arcsin⁡x,sin⁡−1x\arcsin x, \quad \sin^{-1} x

\arcsin, \arccos and \arctan are built in. \sin^{-1} x is common too, but keep one notation in a report so it is not mistaken for 1 over \sin x.

Degrees

\sin 30^\circ = \frac{1}{2}
sin⁡30∘=12\sin 30^\circ = \frac{1}{2}

The degree sign is ^\circ in math mode. With the siunitx package, \ang{30} prints the same and keeps the spacing consistent with the other units in the document.

Argument with several terms

x(t) = A \sin(\omega t + \varphi)
x(t)=Asin⁡(ωt+φ)x(t) = A \sin(\omega t + \varphi)

An argument made of several terms needs brackets. \left and \right are only worth adding when the argument contains a fraction or another tall element.

Hyperbolic functions

\sinh x, \quad \cosh x, \quad \tanh x
sinh⁡x,cosh⁡x,tanh⁡x\sinh x, \quad \cosh x, \quad \tanh x

The hyperbolic functions have their own commands as well. Their inverses such as arcsinh are missing from standard LaTeX, so write them with \operatorname{arcsinh}.

Common mistakes

See also

Don't want to memorize commands?

Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.

Try it free