Skip to content
ihateDesmos

Tan graph: y = tan x

Updated 20 October 2026 · Values computed by the ihateDesmos engine

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.

−6−4−2246−4−2240
Open in calculator
The graph of
y=tan(x)
for −7 ≤ x ≤ 7. Dots mark its roots and y-intercept.

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.

Values of tan x
xy = tan x
−π/3−√3
−π/4−1
−π/6−√3/3
00
π/6√3/3
π/41
π/3√3

How to graph tan x by hand

  1. 1
    Draw dashed vertical asymptotes at x = −π/2 and x = π/2.
  2. 2
    Plot (−π/4, −1), (0, 0) and (π/4, 1).
  3. 3
    Draw a curve through them that bends to follow each asymptote, going down on the left and up on the right without ever touching them.
  4. 4
    Copy 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.

−6−4−2246−4−2240
  • 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?
π (180°). Unlike sine and cosine, tangent repeats every π because tan(x + π) = tan x.
Where are the asymptotes of y = tan x?
At x = π/2 + nπ for every integer n, where cos x = 0 and the ratio sin x / cos x is undefined.
What are the domain and range of tan x?
The domain is every real number except π/2 + nπ; the range is all real numbers.
Why does my calculator draw vertical lines on the tan graph?
Most calculators sample the function at evenly spaced points and join them, which bridges each asymptote with a near-vertical line. Those lines are artefacts, not part of the graph.
Is tan x an odd function?
Yes: tan(−x) = −tan x, so the graph is symmetric about the origin.

Related graphs

Graph tan x your way

Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.

Open in the calculator