The Tangent function (tan(x))
The tangent function, written tan(x), is one of the three primary trigonometric functions, alongside sine and cosine. In a right triangle, tan(θ) equals the side opposite the angle divided by the side adjacent to it — the TOA in SOH-CAH-TOA. Equivalently, tan(x) = sin(x) / cos(x). Geometrically, tan(θ) measures the slope of a line that passes through the origin and makes angle θ with the positive x-axis. This dual identity — ratio of sides AND slope of a line — is why tangent shows up in surveying, ramp design, optics, signal processing, and the chain rule of calculus.
Unlike sine and cosine, which stay politely between −1 and +1, tangent shoots to ±∞ at certain angles. Its key properties are:
- Periodicity: tan(x) repeats every π radians (180°), not 2π. So tan(x) = tan(x + kπ) for any integer k. This shorter period comes directly from sin and cos both flipping sign together every π.
- Vertical asymptotes: because cos(x) = 0 at x = π/2, 3π/2, 5π/2, …, the tangent is undefined there — the graph rockets to ±∞. The function never actually touches these asymptotes; it gets arbitrarily close.
- Odd symmetry: tan(−x) = −tan(x). The curve has rotational symmetry about the origin, the same as sin.
- Unbounded range: tan(x) can take any real value, from −∞ to +∞. This is why arctan, which inverts it, accepts every real number as input.
- Graph: a repeating pattern of S-curves separated by vertical asymptotes; each branch passes through (kπ, 0) and rises monotonically from −∞ to +∞.
Tangent is used heavily in fields where slopes, gradients, or angles of elevation matter: civil engineering (road grades), surveying (heights of inaccessible objects), computer graphics (camera field-of-view), optics (Snell's law in some formulations), and electrical engineering (impedance phase angles). In calculus, tan and arctan are entangled with the chain rule, integration by trigonometric substitution, and the famous Weierstrass substitution u = tan(x/2) that turns rational trig integrals into ordinary rational integrals.
What is Degrees (deg °) and Radians (rad)?
Trigonometric functions accept angles in two standard units: degrees and radians. Mixing them up is one of the most common sources of wrong answers in physics and engineering homework, so it pays to understand the difference.
- Degrees: a full circle is split into 360 parts. The number 360 is historical — it has divisors 2, 3, 4, 5, 6, 8, 9, 10, 12, … which made fractions easy for Babylonian astronomers around 2000 BCE.
- Radians: a full circle is 2π ≈ 6.283 radians. One radian is the angle subtended at the center of a circle by an arc whose length equals the radius. Radians are the natural unit in calculus because d/dx tan(x) = sec²(x) only works when x is in radians.
To convert between the two units, use these formulas — they are inverses of each other:
- Degrees to radians: radians = degrees × π180
- Radians to degrees: degrees = radians × 180π
Table of common tangent values
| Angle (°) | Angle (Radians) | tan(angle) | tan(angle) |
|---|
| 0° | 0 | 0 | 0.000 |
| 30° | π/6 | 1/√3 or √3/3 | 0.577 |
| 45° | π/4 | 1 | 1.000 |
| 60° | π/3 | √3 | 1.732 |
| 90° | π/2 | Undefined | - |
| 120° | 2π/3 | -√3 | -1.732 |
| 135° | 3π/4 | -1 | -1.000 |
| 150° | 5π/6 | -1/√3 or -√3/3 | -0.577 |
| 180° | π | 0 | 0.000 |
| 210° | 7π/6 | 1/√3 or √3/3 | 0.577 |
| 225° | 5π/4 | 1 | 1.000 |
| 240° | 4π/3 | √3 | 1.732 |
| 270° | 3π/2 | Undefined | - |
| 300° | 5π/3 | -√3 | -1.732 |
| 315° | 7π/4 | -1 | -1.000 |
| 330° | 11π/6 | -1/√3 or -√3/3 | -0.577 |
| 360° | 2π | 0 | 0.000 |
Note that tan(90°) and tan(270°) are undefined, marked here with a dash. The actual values blow up toward +∞ on one side of those angles and −∞ on the other, depending on the direction of approach. Numerically, a calculator near 90° will return huge numbers like 1e15 because cos(89.99999°) is tiny but not exactly zero.
Frequently Asked Questions
Tangent is defined as sin(x) divided by cos(x). At 90°, sin(90°) = 1 and cos(90°) = 0, so tan(90°) = 1/0, which is undefined — division by zero. Geometrically, tan(θ) is the slope of a line through the origin making angle θ with the x-axis. At 90°, that line is vertical, and vertical lines have no defined slope (rise over zero run). Approaching 90° from below, tan grows without bound: tan(89°) ≈ 57, tan(89.9°) ≈ 573, tan(89.99°) ≈ 5,729. Approaching from above, it dives to −∞: tan(91°) ≈ −57. This break is why the tangent graph has vertical asymptotes at every odd multiple of π/2 (90°, 270°, 450°, …). The same issue happens with cot at multiples of π, and with sec and csc — anywhere a trig function's denominator hits zero.
Draw a right triangle with legs of length opposite (o) and adjacent (a), and hypotenuse h. By definition, sin(θ) = o/h, cos(θ) = a/h, and tan(θ) = o/a. Dividing the first two: sin(θ)/cos(θ) = (o/h) / (a/h) = (o/h) · (h/a) = o/a = tan(θ). So tan = sin/cos isn't a separate definition; it's a direct consequence of how the three functions are set up. This identity is the most-used one in trig because it lets you convert tangent problems into sine/cosine problems (which are bounded and well-behaved) and vice versa. It also makes the tangent's asymptotes obvious: wherever cos hits zero, you're dividing by zero. The derivative rule tan'(x) = sec²(x) also drops out of the quotient rule applied to this identity, plus the Pythagorean identity sin² + cos² = 1.
Arctan, written tan⁻¹(x) or atan(x), takes any real number and returns an angle. Because tan repeats every π, arctan must pick a canonical interval — by convention, (−π/2, +π/2), or equivalently (−90°, +90°). So arctan(1) = 45°, arctan(−1) = −45°, arctan(very-large-number) approaches 90°, and arctan(very-negative-number) approaches −90°. The catch: arctan alone cannot distinguish a point at (1, 1) from a point at (−1, −1) — both have slope 1, both give arctan(1) = 45°, but they live in different quadrants. That's why programming languages provide atan2(y, x), which takes both coordinates and returns the full angle in (−π, π], correctly placing the point in its actual quadrant. Atan2 is the function you actually want for computing angles in computer graphics, robotics, and navigation. Never compute atan(y/x) when you have both x and y available; atan2 is correct in all four quadrants and handles x = 0 gracefully.
Sine and cosine both have period 2π — they return to their starting value after a full circle. Tangent, by contrast, repeats every half-circle. Here's why: tan(x + π) = sin(x + π) / cos(x + π) = (−sin(x)) / (−cos(x)) = sin(x)/cos(x) = tan(x). When you rotate by 180°, both sine and cosine flip sign, and the two negatives cancel inside the ratio. Geometrically, the line through the origin at angle θ is exactly the same line as the one at angle θ + 180° — they have the same slope. Slope is what tangent measures, so tangent cannot tell the two angles apart, and the function repeats. This shorter period is also why arctan has a narrower output interval than arcsin or arccos.
For a line in the xy-plane, slope is defined as rise over run: how much y changes for a unit change in x. If a line makes angle θ with the positive x-axis (measured counter-clockwise), then for every horizontal run of cos(θ), the line rises by sin(θ). So slope = sin(θ)/cos(θ) = tan(θ). This identity is the bridge between geometry and algebra. A 45° line has slope tan(45°) = 1, a 30° line has slope tan(30°) = 1/√3 ≈ 0.577, and a vertical line has slope tan(90°) which is undefined — matching the algebraic intuition that vertical lines have infinite slope. Civil engineers exploit this for road grades: a 5% grade is a slope of 0.05, which corresponds to an angle of arctan(0.05) ≈ 2.86°. Wheelchair ramps in the US are required to be no steeper than 1:12, which is tan⁻¹(1/12) ≈ 4.76°.
When integrating rational functions of sin and cos, calculus students learn the substitution u = tan(x/2). It is magical: it converts any rational expression in sin(x) and cos(x) into a rational expression in u, which you can then attack with partial fractions. The three key identities are sin(x) = 2u/(1+u²), cos(x) = (1−u²)/(1+u²), and dx = 2/(1+u²) du. For example, ∫ dx / (1 + cos(x)) becomes ∫ 2 du / (1 + (1−u²)/(1+u²)) · 1/(1+u²) = ∫ du = u + C = tan(x/2) + C. This trick is named after Karl Weierstrass, the 19th-century German analyst, although Euler used it a century earlier. It is one of the most powerful techniques in elementary integral calculus and routinely cracks integrals that defeat every other approach.
Tangent has vertical asymptotes at 90° and 270°, where cos hits zero. Near those points, cos is tiny but nonzero, and dividing by a tiny number gives a huge result. tan(89.9999°) is roughly 572,957 because cos(89.9999°) ≈ 0.00000175. The value is mathematically correct, just dramatic. There's also a numerical pitfall: if you compute tan as sin/cos directly in floating-point, you may lose precision near the asymptote because cos is in the regime where IEEE-754 doubles can no longer represent the exact value. High-quality math libraries (Intel's MKL, OpenLibm) use range reduction tricks and dedicated polynomial approximations to deliver correctly-rounded results even at extreme angles. In practice, if you find yourself working within microdegrees of 90°, you probably want to reframe the problem in terms of cot(x) = cos(x)/sin(x), which behaves nicely there.
Surveying: to measure the height of a tall building or mountain without climbing it, you measure the angle of elevation θ from a known distance d, and compute height = d · tan(θ). Civil engineering: road grades and ramp slopes are tangent ratios. Optics: the camera field of view satisfies tan(FOV/2) = (sensor width / 2) / focal length, which lets photographers calculate exactly what's in frame. Electrical engineering: in AC circuits, the phase angle between voltage and current is arctan(reactance / resistance) — the tangent of the phase angle equals the ratio. Computer graphics: a perspective projection matrix uses cot(fovy/2) — the cotangent of half the field of view — to scale objects correctly. Navigation: the bearing between two GPS coordinates uses atan2 on the difference in longitudes and latitudes. Astronomy: stellar parallax measurements use tan(θ) ≈ θ for tiny angles to convert observed shifts into distances in parsecs. Whenever the relationship between an angle and a ratio of two lengths matters, tangent appears.