Graph of y = tan x (Tangent function)

· How we calculate · Free, no sign-up

Quick answer

The graph of y = tan x is a series of rising branches separated by vertical asymptotes at x = ±π/2, ±3π/2, …. Domain: x ≠ π/2 + kπ; range: All real numbers (−∞, ∞). x-intercept: x = kπ; y-intercept: y = 0. It is odd (symmetric about the origin).

Functiony = tan x
Domainx ≠ π/2 + kπ
RangeAll real numbers (−∞, ∞)
x-intercept(s)x = kπ
y-intercepty = 0
Derivativesec² x = 1/cos² x
Graph of y = tan x for −2π ≤ x ≤ 2π−2π−3π/2−π−π/20π/2π3π/22π−5−4−3−2−1012345
Graph of y = tan x for −2π ≤ x ≤ 2π, −5 ≤ y ≤ 5. Dashed lines are asymptotes. Dots mark intercepts.
Zoom, pan and trace y = tan x in the interactive grapher.Open the Graphing Calculator →

What the graph of y = tan x looks like

tan x = sin x / cos x, so it is undefined wherever cos x = 0 — at x = ±π/2, ±3π/2 and so on — and the graph has vertical asymptotes there. Between each pair of asymptotes the curve rises from −∞ to +∞, passing through a zero at x = kπ, so tangent repeats every π rather than every 2π.

Its slope sec² x is never less than 1, so every branch is increasing (but tan x is not increasing over its whole domain). Geometrically, tan x is the slope of the line making angle x with the positive x-axis.

Key features of y = tan x

Key features of y = tan x
PropertyValue
Functiony = tan x (Tangent function)
FamilyTrigonometric
Domainx ≠ π/2 + kπ
RangeAll real numbers (−∞, ∞)
x-intercept(s)x = kπ
y-intercepty = 0
SymmetryOdd — symmetric about the origin
AsymptotesVertical x = π/2 + kπ
Periodπ ≈ 3.1416
Increasing on(−π/2 + kπ, π/2 + kπ) for every integer k
Decreasing onNever
Key pointsInflection points at (kπ, 0); tan(π/4) = 1
Derivative f′(x)sec² x = 1/cos² x
Antiderivative ∫ f(x) dx−ln|cos x| + C

Symmetry: Odd — symmetric about the origin. For example f(2) = −2.185 while f(−2) = 2.185, its negative, so the graph looks the same after a half-turn about the origin. Intercepts: the graph meets the x-axis at x = kπ and the y-axis at y = 0.

Table of values for y = tan x

Values of y = tan x
xy = tan xSlope f′(x)
−π01
−π/2undefinedundefined
−π/4−12
001
π/60.57741.3333
π/412
π/31.73214
π/2undefinedundefined
2π/3−1.73214
3π/4−12
π01
3π/2undefinedundefined
2π01

How to sketch y = tan x by hand

Plot the points from the table — (−π, 0), (−π/4, −1), (0, 0), (π/6, 0.5774), (π/4, 1), (π/3, 1.7321) — on axes running from about −2π to 2π horizontally. Draw the asymptotes first (vertical x = π/2 + kπ) as dashed lines; the curve gets ever closer to them without crossing in that direction. Then join the points with a smooth curve. As a check on the shape — increasing: (−π/2 + kπ, π/2 + kπ) for every integer k; decreasing: Never.

Derivative, tangent line and area

The derivative of y = tan x is sec² x = 1/cos² x, which gives the slope of the curve at each point (the third column of the table). At x = 1 the curve is at height 1.5574 and its slope is f′(1) = 3.4255, so the tangent line there is y = 3.4255x − 1.8681.

The signed area under the curve from x = 0 to x = π/4 is 0.3466, found using the antiderivative −ln|cos x| + C.

Related graphs and transformations

Browse all graphs of common functions by family, or open the graphing calculator.

Frequently asked questions

What is the domain and range of y = tan x?

Domain: x ≠ π/2 + kπ. Range: All real numbers (−∞, ∞).

What are the intercepts of y = tan x?

x-intercept(s): x = kπ. y-intercept: y = 0.

What is the derivative of y = tan x?

f′(x) = sec² x = 1/cos² x. At x = 1 the curve is at height 1.5574 and its slope is f′(1) = 3.4255, so the tangent line there is y = 3.4255x − 1.8681.

Is y = tan x even, odd or neither?

Odd — symmetric about the origin. For example f(2) = −2.185 while f(−2) = 2.185, its negative, so the graph looks the same after a half-turn about the origin.

Does y = tan x have asymptotes?

Vertical x = π/2 + kπ. The function is periodic with period π ≈ 3.1416.