Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Graph a Tangent Function

A tangent graph is a row of identical branches separated by vertical asymptotes. Each branch is centred on a zero, rises through it, and runs off to infinity at the asymptotes half a period away on either side.

Recognize the task

"Graph y=2tan⁡(x−π4)y = 2\tan(x - \frac{\pi}{4})", "find the asymptotes of y=tan⁡2xy = \tan 2x", "state the period". Test: a tangent (or cotangent) with numbers in front or inside.
The basic graph is in Graph of the Tangent Function; the tangent repeats every π\pi (periodicity identities).

Steps

StepOn y=2tan⁡(x−π4)y = 2\tan(x - \frac{\pi}{4})
1Find the period. Tangent: π∣B∣\frac{\pi}{|B|}, not 2π∣B∣\frac{2\pi}{|B|}.period π\pi
2Find the centre of one branch. Where the bracket is 00: x=Cx = C. The graph passes through (C,D)(C, D) there.centre x=π4x = \frac{\pi}{4}, point (π4,0)(\frac{\pi}{4}, 0)
3Place the asymptotes half a period either side. Where the bracket equals ±π2\pm\frac{\pi}{2}.x=−π4x = -\frac{\pi}{4} and x=3π4x = \frac{3\pi}{4}
4Plot the quarter points and draw the branch. Halfway to each asymptote the height is D±AD \pm A. Repeat the branch every period.(0,−2)(0, -2) and (π2,2)(\frac{\pi}{2}, 2); branches every π\pi

Worked examples

Example 1 · horizontal squeeze

B = 2
y=tan⁡2xy = \tan 2x: period π2\frac{\pi}{2}
asymptotes x=π4+kπ2x = \frac{\pi}{4} + \frac{k\pi}{2}
where 2x=π2+kπ2x = \frac{\pi}{2} + k\pi

Example 2 · reflected and stretched

decreasing branches
y=−tan⁡x2y = -\tan\frac{x}{2}: period 2π2\pi, asymptotes x=±πx = \pm\pi
each branch falls from left to right through (0,0)(0, 0)

Example 3 · the trace

shifted
y=2tan⁡(x−π4)y = 2\tan(x - \frac{\pi}{4})
period π\pi, zero at π4\frac{\pi}{4}, asymptotes −π4-\frac{\pi}{4}, 3π4\frac{3\pi}{4}

See it happen

tan(0.785) = 1.0000

● curve● current point┊ asymptotes−−− y = -1, 1drag to pan · wheel to zoom
Domain: [-2π, 2π]  |  Range: [-6.0, 6.0]
Function
Unit
Result
tan(π/4) = 1.0000
Anglerad
Quick
Explanations
tan(θ) = sin(θ) / cos(θ). Period: π. Vertical asymptotes where cos(θ) = 0, i.e. at π/2 + πk. Range: all real numbers. Zeros at integer multiples of π.
tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x} blows up wherever cos⁡x=0\cos x = 0, which happens every π\pi: that is why the tangent has asymptotes instead of a minimum and a maximum, and why its period is half that of sine.

Common mistakes

Using the sine period

✗ period of tan⁡2x\tan 2x is π\pi
✓ π2\frac{\pi}{2}

Asymptotes at the zeros

✗ asymptote at x=0x = 0 for tan⁡x\tan x
✓ tan⁡0=0\tan 0 = 0; asymptotes are at ±π2\pm\frac{\pi}{2}

Calling A an amplitude

✗ "amplitude 22" for 2tan⁡x2\tan x
✓ tangent is unbounded; AA only sets the height at the quarter points