Trigonometric functions in LaTeX
\sin, \cos and \tan (with \cot, \sec, \csc) are LaTeX's built-in operator commands for the trigonometric functions; they set the function name upright with the correct spacing before its argument, instead of italicising it like a variable.
LaTeX command
\sin, \cos, \tanNot the symbol you meant? Draw it to find the command →
Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →
Typing sin x by hand without the command italicises every letter, s, i, n, as if they were three multiplied variables, which is both wrong and cramped. \sin x tells LaTeX this is a named function: it prints upright roman letters and adds the small gap a function name needs before its argument.
Powers go directly on the command name, before the argument: \sin^2\theta, not \sin\theta^2. This convention, seen in \sin^2\theta + \cos^2\theta = 1, is the standard way trig identities appear in print, and (\sin\theta)^2 works too when the argument itself is complicated.
Inverse functions have their own commands, \arcsin, \arccos, \arctan, which avoid the ambiguous \sin^{-1} notation some readers misread as a reciprocal. The hyperbolic versions \sinh, \cosh, \tanh, \coth follow the same upright convention.
Other forms
\arcsin, \arccos, \arctaninverse\sinh, \cosh, \tanhhyperbolicExamples
$\sin^2\theta + \cos^2\theta = 1$the Pythagorean identity
$\tan\theta = \dfrac{\sin\theta}{\cos\theta}$tangent as a ratio
$\arcsin(1) = \dfrac{\pi}{2}$the inverse sine
$\sinh x = \dfrac{e^x - e^{-x}}{2}$hyperbolic sine defined via exponentials
$\cos(a-b) = \cos a\cos b + \sin a\sin b$the angle-subtraction formula
Tips and common mistakes
- Never write sin, cos or tan as plain text in maths mode; italic sin reads as s times i times n. Always use the command.
- Write the power on the command name,
\sin^2x, not on the argument,\sinx^2 means something different. \tan,\cot,\secand\cscare all built in alongside\sinand\cos, and\cothis the standard hyperbolic form too, though\sechand\cschare not standard, define them with\operatorname{sech}if you need them.- Use
\arcsin,\arccos,\arctanfor inverses rather than\sin^{-1}, which some readers confuse with 1/\sin. - For sine squared,
\sin^2\thetais the standard form; (\sin\theta)^2 is equivalent and can be clearer when the argument is itself a longer expression.
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
Why does sin look italic and cramped when I don't use \sin?
Without the command, LaTeX treats each letter as a separate italic variable multiplied together; \sin switches to the built-in operator, which is upright and correctly spaced from its argument.
How do I write inverse sine?
Use \arcsin, for example \arcsin(x); \sin^{-1}(x) is sometimes used instead but can be misread as a reciprocal.
How do I write sine squared?
\sin^2\theta, with the exponent placed on the command itself rather than after the argument.
Is there a LaTeX command for cot, sec and csc?
Yes, \cot, \sec and \csc are all built in alongside \sin, \cos and \tan, and behave the same way.