Graphs of tangent, cotangent, secant, and cosecant

Sine and cosine are defined for every ${x}$. The other four functions are fractions, so they are undefined where their denominators are zero. Near those points, their graphs shoot up or down without end. This page draws all four graphs.

The graph of tangent

Since ${\tan x=\dfrac{\sin x}{\cos x}}$, tangent is undefined where ${\cos x=0}$. That is at ${x=\pm\dfrac{\pi}{2}}$, ${\pm\dfrac{3\pi}{2}}$, and so on.

Tangent has period ${\pi}$ (see The unit circle). So it is enough to graph it between ${-\dfrac{\pi}{2}}$ and ${\dfrac{\pi}{2}}$. Tangent is odd, so the values for negative ${x}$ are the negatives of these:

${x}$${\tan x}$
${0}$${0}$
${\dfrac{\pi}{6}}$${0.58}$
${\dfrac{\pi}{4}}$${1}$
${\dfrac{\pi}{3}}$${1.73}$
${1.5}$${14.1}$
${1.57}$${1255.8}$

As ${x}$ gets close to ${\dfrac{\pi}{2}}$ from the left, ${\cos x}$ gets close to ${0}$ while ${\sin x}$ is close to ${1}$. Dividing by a tiny positive number gives a huge positive number. So ${\tan x}$ grows without bound. In the notation of College Algebra (see Rational functions):

${\tan x\to\infty}$ as ${x\to\dfrac{\pi}{2}^-}$

So the line ${x=\dfrac{\pi}{2}}$ is a vertical asymptote: a vertical line the graph comes closer and closer to but never touches.

−3π/2−π/2π/23π/2−3−113xy
The graph of ${y=\tan x}$. The dashed lines are vertical asymptotes.

The graph is made of identical branches, one between each pair of asymptotes. Each branch rises from left to right and passes through a zero halfway between its asymptotes.

${y=\tan x}$: period ${\pi}$, asymptotes ${x=\dfrac{\pi}{2}+n\pi}$, zeros ${x=n\pi}$

Here ${n}$ is any integer. The range of tangent is all real numbers.

The graph of cotangent

Since ${\cot x=\dfrac{\cos x}{\sin x}}$, cotangent is undefined where ${\sin x=0}$: at ${x=0}$, ${\pm\pi}$, ${\pm 2\pi}$, and so on. Its graph looks like the tangent graph, but each branch falls from left to right.

−π−π/2π/2π−3−113xy
The graph of ${y=\cot x}$. Its asymptotes are at the multiples of ${\pi}$.

${y=\cot x}$: period ${\pi}$, asymptotes ${x=n\pi}$, zeros ${x=\dfrac{\pi}{2}+n\pi}$

Transformations of tangent

For ${k>0}$, the graph of ${y=a\tan k(x-b)}$ has period ${\dfrac{\pi}{k}}$, not ${\dfrac{2\pi}{k}}$, because tangent's own period is ${\pi}$.

To graph one branch, find where the inside equals ${-\dfrac{\pi}{2}}$ and ${\dfrac{\pi}{2}}$:

$-\dfrac{\pi}{2}<k(x-b)<\dfrac{\pi}{2}$

Solving for ${x}$ gives the two asymptotes. The zero is halfway between them. Halfway between the zero and each asymptote, the value is ${a}$ or ${-a}$.

Example 1: Graph ${y=3\tan 2x}$.

Solution:

The period is ${\dfrac{\pi}{2}}$. For one branch, solve

$\begin{align*}-\dfrac{\pi}{2}&<2x<\dfrac{\pi}{2}\\-\dfrac{\pi}{4}&<x<\dfrac{\pi}{4}\end{align*}$

So the asymptotes are ${x=-\dfrac{\pi}{4}}$ and ${x=\dfrac{\pi}{4}}$. The zero is at ${x=0}$.

Halfway to each asymptote, at ${x=\pm\dfrac{\pi}{8}}$, the inside is ${2x=\pm\dfrac{\pi}{4}}$. So $y=3\tan\left(\pm\dfrac{\pi}{4}\right)=\pm 3$.

−π/4−π/8π/8π/4−33xy
The graph of ${y=3\tan 2x}$. One branch lies between ${x=-\dfrac{\pi}{4}}$ and ${x=\dfrac{\pi}{4}}$.

Copies of this branch repeat every ${\dfrac{\pi}{2}}$.

Example 2: Graph ${y=-\tan\left(x-\dfrac{\pi}{4}\right)}$.

Solution:

Here ${k=1}$, so the period is ${\pi}$. For one branch, solve

$\begin{align*}-\dfrac{\pi}{2}&<x-\dfrac{\pi}{4}<\dfrac{\pi}{2}\\-\dfrac{\pi}{4}&<x<\dfrac{3\pi}{4}\end{align*}$

The zero is halfway, at ${x=\dfrac{\pi}{4}}$. At ${x=0}$, ${y=-\tan\left(-\dfrac{\pi}{4}\right)=1}$. At ${x=\dfrac{\pi}{2}}$, ${y=-\tan\dfrac{\pi}{4}=-1}$.

Because of the minus sign, the branch falls from left to right.

−π/4π/4π/23π/4xy
The graph of ${y=-\tan\left(x-\dfrac{\pi}{4}\right)}$. The minus sign makes the branches fall.

The graphs of secant and cosecant

Since ${\sec x=\dfrac{1}{\cos x}}$, draw the cosine graph first, then take reciprocals:

−π−π/2π/2π3π/22π−11xy
The graph of ${y=\sec x}$ (blue) and ${y=\cos x}$ (dashed). Each branch touches the cosine curve at a high or low point.

Since ${|\cos x|\le 1}$, its reciprocal has ${|\sec x|\ge 1}$. So the graph never enters the band between ${y=-1}$ and ${y=1}$. The cosecant graph is made from the sine graph in the same way:

−π−π/2π/2π3π/22π−11xy
The graph of ${y=\csc x}$ (blue) and ${y=\sin x}$ (dashed). The asymptotes are where ${\sin x=0}$.

Both have period ${2\pi}$, like the functions they come from.

Example 3: Graph one period of ${y=2\csc 2x}$.

Solution:

First graph the matching sine curve, ${y=2\sin 2x}$. It has amplitude ${2}$ and period ${\dfrac{2\pi}{2}=\pi}$. Its key points are

${(0,0)}$, ${\left(\dfrac{\pi}{4},2\right)}$, ${\left(\dfrac{\pi}{2},0\right)}$, ${\left(\dfrac{3\pi}{4},-2\right)}$, ${(\pi,0)}$

Where the sine curve is zero, at ${x=0}$, ${\dfrac{\pi}{2}}$, ${\pi}$, draw asymptotes. At its high point ${\left(\dfrac{\pi}{4},2\right)}$, draw a branch that opens up. At its low point ${\left(\dfrac{3\pi}{4},-2\right)}$, draw a branch that opens down.

π/4π/23π/4π−22xy
One period of ${y=2\csc 2x}$ (blue), drawn from the sine curve ${y=2\sin 2x}$ (dashed).

Summary

Here ${n}$ is any integer:

FunctionPeriodAsymptotes
${\tan x}$${\pi}$${x=\dfrac{\pi}{2}+n\pi}$
${\cot x}$${\pi}$${x=n\pi}$
${\sec x}$${2\pi}$${x=\dfrac{\pi}{2}+n\pi}$
${\csc x}$${2\pi}$${x=n\pi}$