Tan graph: y = tan x
The tangent graph is a row of identical rising branches, each climbing from −∞ to +∞ between two vertical asymptotes. It repeats every π, crosses the x-axis at multiples of π, and is undefined wherever cos x = 0.
Key features
- Domain
- All real x except x = π/2 + nπ
- Range
- All real numbers
- Period
- π ≈ 3.1416
- Vertical asymptotes
- x = π/2 + nπ
- Zeros
- x = nπ
- Amplitude
- None: every branch is unbounded
- Symmetry
- Odd: tan(−x) = −tan x
- y-intercept
- None
- Derivative
- 1cos(x)2
- Antiderivative
- −ln(cos(x))+C
Derivative and antiderivative from the calculator’s algebra system. Domain, range and asymptotes are stated for real x.
What the graph of tan x looks like
Since tan x = sin x / cos x, the graph blows up wherever cos x = 0, at x = ±π/2, ±3π/2 and so on. Between each pair of asymptotes there is one branch: it comes up from −∞, passes through a zero at the midpoint and rises to +∞.
Every branch is a copy of the one through the origin, shifted by a multiple of π, so the period is π rather than 2π. The branches are always increasing, because the derivative sec²x is never less than 1.
Near the origin the graph hugs the line y = x, since tan x ≈ x for small x. Each branch bends from concave down to concave up exactly where it crosses the x-axis.
Points of interest
Found numerically to about twelve digits in the window −7 ≤ x ≤ 7, then shown in exact form where one exists.
- x-intercepts (roots)
- x = −6.2832, x = −3.1416, x = 0, x = 3.1416, x = 6.2832
- Local maxima
- None in this window
- Local minima
- None in this window
- Inflection points
- (−2π, 0), (−π, 0), (0, 0), (π, 0), (2π, 0)
The vertical lines you see in many plots of tan x are not part of the graph. They come from joining the last sample before an asymptote to the first sample after it. The calculator recognises each jump to infinity and breaks the curve there.
Table of values
A few points to plot, with exact values where they are simple.
| x | y = tan x |
|---|---|
| −π/3 | −√3 |
| −π/4 | −1 |
| −π/6 | −√3/3 |
| 0 | 0 |
| π/6 | √3/3 |
| π/4 | 1 |
| π/3 | √3 |
How to graph tan x by hand
- 1Draw dashed vertical asymptotes at x = −π/2 and x = π/2.
- 2Plot (−π/4, −1), (0, 0) and (π/4, 1).
- 3Draw a curve through them that bends to follow each asymptote, going down on the left and up on the right without ever touching them.
- 4Copy that branch every π to the left and right.
Transformations
How the graph moves when you change the formula. The original is tan x in blue.
y = tan(x/2)Period 2π: the branches are twice as wide, with asymptotes at x = π + 2nπ.y = 2tan(x)Vertically stretched: each branch is steeper, but the asymptotes stay put.y = tan(x - pi/4)Shifted right by π/4: the zeros move to π/4 + nπ and the asymptotes to 3π/4 + nπ.
Common mistakes
- Drawing the asymptotes as part of the curve. The graph approaches them but never reaches them.
- Using a period of 2π. Tangent repeats every π.
- Expecting a maximum or minimum. tan x is unbounded on every branch.
Where it shows up
- The slope of a line making angle θ with the x-axis is tan θ.
- Heights and distances: height = distance × tan(angle of elevation).
Frequently asked questions
What is the period of the tan graph?
Where are the asymptotes of y = tan x?
What are the domain and range of tan x?
Why does my calculator draw vertical lines on the tan graph?
Is tan x an odd function?
Related graphs
Period 2π, amplitude 1, zeros at every multiple of π.
The sine wave shifted left by π/2; starts at its peak.
Period π, asymptotes at multiples of π, always decreasing.
1/cos x: U-shaped branches, never between −1 and 1.
All real inputs, outputs between −π/2 and π/2.
S-curve between −1 and 1; a classic activation function.
Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.