Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 38 Β· Graphs of Trigonometric Functions

The Graph of Tangent

Sketch y = tan x, understand its vertical asymptotes and period of Ο€, see how it differs from sine and cosine, and graph transformed tangent functions.

Sine and cosine are smooth waves that never leave the strip between βˆ’1 and 1. The tangent function behaves very differently: it shoots off to infinity at certain angles and then comes back from the other side. In this lesson you will see why, and learn to sketch it.

Where the shape comes from

Recall tan x = sin x / cos x. On the unit circle, tan x is the slope of the radius, y/x.

  • At x = 0, sin = 0, so tan 0 = 0.
  • As x grows toward Ο€/2, cos x shrinks toward 0 while sin x approaches 1. Dividing by a tiny positive number gives a huge positive number: tan x β†’ +∞.
  • At x = Ο€/2 itself, cos = 0, so the tangent is undefined. The graph has a vertical asymptote there.
  • Just after Ο€/2, cos x is a tiny negative number, so tan x is hugely negative and then rises through 0 at x = Ο€.

Key features of y = tan x

  • Domain: all real numbers except x = Ο€/2 + kΟ€ (k any integer).
  • Range: all real numbers (the graph covers every height).
  • Period: Ο€, not 2Ο€. Tangent repeats twice as fast as sine, because tan(x + Ο€) = tan x: moving half a turn flips both sine and cosine, and the signs cancel.
  • Zeros: at x = kΟ€.
  • Asymptotes: the vertical lines x = Ο€/2 + kΟ€.
  • Symmetry: odd, tan(βˆ’x) = βˆ’tan x.
  • Always increasing between asymptotes. There is no amplitude, because the graph is unbounded.
Python Plot the tangent function

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Numbers near an asymptote

Python Tangent blows up near Ο€/2

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You will see large positive values on the left and large negative values on the right.

Key points for one cycle

Between asymptotes βˆ’Ο€/2 and Ο€/2 the standard branch passes through:

x βˆ’Ο€/4 0 Ο€/4
tan x βˆ’1 0 1

A quick sketch: draw asymptotes at Β±Ο€/2, plot these three points, and curve toward the asymptotes. Then repeat every Ο€.

Transformations

For y = A tan(B(x βˆ’ C)) + D:

  • The period is Ο€ / |B|.
  • Vertical asymptotes lie halfway through each period on both sides of the center point. The center is at x = C, and the asymptotes are at x = C Β± Ο€/(2|B|).
  • A stretches the graph vertically; there is no amplitude, but A changes the steepness. A negative A flips the graph so it decreases.
  • D moves the whole graph up or down. The point (C, D) is the "center" of each branch.

Example. y = 2 tan(3x).

  • Period: Ο€/3.
  • Center at x = 0, asymptotes at x = Β±Ο€/6.
  • At x = Ο€/12: 2 tan(Ο€/4) = 2. At x = βˆ’Ο€/12: βˆ’2.
Python Transformed tangent

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Tangent as a slope

Because tan ΞΈ = rise / run, it is the slope of a line that makes angle ΞΈ with the x-axis. A 45Β° line has slope 1; a steeper line has a larger slope; a vertical line (90Β°) has no slope at all, which matches the asymptote. This is how the tangent function links geometry to algebra.

Calculators show an error for tan 90Β°. That is not a bug: it is the asymptote.

The reciprocal graphs

The other three functions are reciprocals: csc x = 1/sin x, sec x = 1/cos x, cot x = 1/tan x. Their graphs have asymptotes wherever the denominator is zero. For example sec x has asymptotes where cos x = 0, which are the same places as the tangent's asymptotes. We use them rarely in sketches, but the idea is the same.

Worked example

Find the period, asymptotes, and one zero of y = tan(x/2).

  • Period: Ο€ / (1/2) = 2Ο€.
  • Center at 0; asymptotes at x = Β±Ο€/(2 Γ— 1/2) = Β±Ο€.
  • A zero at x = 0 (and at 2Ο€, βˆ’2Ο€, …).

Check your understanding

Quick check Β· 4 questions

of 4 answered You scored / 4 Β· perfect!

  1. 1. What is the period of y = tan x?

    Tangent repeats every Ο€ radians.
  2. 2. Where does y = tan x have vertical asymptotes?

    The asymptotes occur where cos x = 0.
  3. 3. What is the range of y = tan x?

    As x approaches the asymptotes, tan x takes arbitrarily large positive and negative values.
  4. 4. What is the period of y = tan(2x)?

    Period = Ο€ / 2.

Summary

  • tan x = sin x / cos x is undefined where cos x = 0, giving vertical asymptotes at Ο€/2 + kΟ€.
  • Period Ο€; range all real numbers; no amplitude; odd function.
  • For y = A tan(B(x βˆ’ C)) + D the period is Ο€ / |B| and asymptotes sit Ο€/(2|B|) either side of the center.
  • Tangent is the slope of the line at angle ΞΈ.

Next: Reciprocal, Quotient and Pythagorean Identities