Trigonometric Functions in LaTeX: \sin, \cos, \tan

The reason sin must be a command rather than three letters, how powers and inverses attach to it, and the degree-symbol problem.

Trigonometric functions are operators, not letters. That single fact explains the upright type, the spacing before the argument, and why \sin^2 x means (sin x)² rather than sin(x²). The degree sign is a superscript circle, and the angle variables are ordinary Greek (Greek Letters) — the two things that most often go wrong in the same formula.

Which one to use

Situation Write this Because
Sine, cosine, tangent
\sin x
Upright operator plus its own spacing.
Reciprocals
\csc, \sec, \cot
Separate commands, never 1/\sin.
A squared function
\sin^2 x
Exponent after the operator name.
The inverse
\arcsin
\sin^{-1} reads as 1/\sin to many readers.
Hyperbolic
\sinh, \cosh
Same pattern with an h suffix.
Degrees
30^{\circ}
Circ is a superscript symbol.

The commands

What Type this Renders as
The three primaries Upright names, with automatic thin space before the argument.
\sin\theta \quad \cos\theta \quad \tan\theta
\sin\theta \quad \cos\theta \quad \tan\theta
Reciprocals American spelling; British texts use cosec, which has no dedicated command.
\sec x \quad \csc x \quad \cot x
\sec x \quad \csc x \quad \cot x
Squared shorthand The exponent attaches to the operator name, which is a LaTeX exception to normal function behaviour.
\sin^2\theta + \cos^2\theta = 1
\sin^2\theta + \cos^2\theta = 1
Inverse function Ambiguous: it reads as arcsine in school texts and as a reciprocal in analysis.
\sin^{-1} x
\sin^{-1} x
Unambiguous inverse No collision with the power-of-negative-one reading, which is why these are safer.
\arcsin x \quad \arctan x
\arcsin x \quad \arctan x
Hyperbolic Separate commands, not sin applied to h.
\sinh x \quad \cosh x \quad \tanh x
\sinh x \quad \cosh x \quad \tanh x
Degrees A raised circle, because LaTeX has no degree unit character in maths mode.
\sin 30^\circ = \frac{1}{2}
\sin 30^\circ = \frac{1}{2}
Radians as default Pure numbers are radians; brackets needed once the argument is anything but a single token.
\sin\left(\frac{\pi}{6}\right)
\sin\left(\frac{\pi}{6}\right)
Argument in brackets \left … \right grows round a fraction; plain ( ) stays x-high and looks undersized.
\tan\left(\frac{\pi}{4}\right)
\tan\left(\frac{\pi}{4}\right)
Greek angle names Most trig errors start here: \theta is transcribed as \the by many OCR passes.
\alpha \quad \beta \quad \theta \quad \phi
\alpha \quad \beta \quad \theta \quad \phi

Worked examples

The identity everyone types wrong

\sin^{2}\theta + \cos^{2}\theta = 1
\sin^{2}\theta + \cos^{2}\theta = 1

Written without the leading backslash, sin² becomes the product s·i·n² in italic and the equation loses its meaning as a statement about an angle.

Addition formula

\sin(A+B) = \sin A\cos B + \cos A\sin B
\sin(A+B) = \sin A\cos B + \cos A\sin B

Capital-letter angles need no special handling; the brackets are ordinary grouping.

Sine rule

\frac{a}{\sin A} = \frac{b}{\sin B}
\frac{a}{\sin A} = \frac{b}{\sin B}

An operator sitting in a denominator still prints upright, which is one reason the command form matters more inside fractions.

Exact value at a standard angle

\cos\left(\frac{\pi}{3}\right) = \frac{1}{2}
\cos\left(\frac{\pi}{3}\right) = \frac{1}{2}

Radian arguments in symbolic work stay as multiples of pi rather than decimals.

Common mistakes

  • Typing sin, log or max as bare words. They print as italic products; the operator commands exist precisely to stop that.
  • Writing \sin^2 x and \sin x^2 interchangeably. The first is (sin x)², the second is sin(x²), and LaTeX will not warn you.
  • Using sin-1 or sin^-1 for arcsine. The minus needs braces and the name needs to be a command.
  • Putting a degree sign as 90° inside maths mode. That character is not in the maths font; write 90^\circ.

Questions about this notation

Why does sin come out in italics?
Because unbraced letters in maths mode are always variables. \sin is a declared operator name with upright font and correct trailing space. If you want the upright word without the operator spacing, \mathrm{sin} also works.
Is \sin^{-1}x arcsine or cosecant?
Genuinely ambiguous, and different fields read it differently. Use \arcsin x when you mean the inverse function and \frac{1}{\sin x} or \csc x when you mean the reciprocal.
How do I write a trigonometric equation with degrees?
Attach ^\circ to the number: \sin 30^\circ = 0.5. Do not reach for \deg, which is an upright operator name meaning the degree of a polynomial, not an angle unit.
How do I write arcsine, secant, or an angle in degrees?
\arcsin, \arccos and \arctan exist and print upright, as do \sec, \csc and \cot. Degrees are a superscript circle: 45^\circ. There is no command for the inverse of secant or cosecant, so write \arcsec only after declaring it, or express it as 1/\cos x for the reciprocal and say which you mean.

Keep reading

Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.