Graph Tangent and Cotangent Functions

This page explains the sketching and graphing of the tangent and cotangent functions of the form:

$$ y = a \tan \big[ k ( x - d) \big] \quad \text{and} \quad y = a \cot \big[ k ( x - d) \big] $$

Detailed examples are provided below to help students understand their behavior, asymptotes, and graph transformations.

Graphing Parameters of $y = \tan(x)$ and $y = \cot(x)$

Range: $ (- \infty , +\infty) $

Period: $ \pi $ (Note: This is different from sine/cosine which have a base period of $2\pi$)

Horizontal Shift (Translation): $d$. The graph shifts left if $(- d)$ is positive, and right if $(- d)$ is negative.


Vertical Asymptotes of Tangent: Occur at the zeros of cosine, given by:

$$ x = \dfrac{\pi}{2} + k\pi, \quad k = 0, \pm 1, \pm 2, \ldots $$

Vertical Asymptotes of Cotangent: Occur at the zeros of sine, given by:

$$ x = k\pi, \quad k = 0, \pm 1, \pm 2, \ldots $$


Identities: To understand key properties of these functions, recall the ratio identities:

$$ y = \tan(x) = \dfrac{\sin(x)}{\cos(x)} \quad \text{and} \quad y = \cot(x) = \dfrac{\cos(x)}{\sin(x)} $$

1) $ y = \tan(x) = \dfrac{\sin(x)}{\cos(x)} $

All zeros of $\sin(x)$ correspond to zeros of $\tan(x)$. All zeros of $\cos(x)$, which appear in the denominator, correspond to vertical asymptotes of $\tan(x)$.

Graph of y = tan(x)

2) $ y = \cot(x) = \dfrac{\cos(x)}{\sin(x)} $

All zeros of $\cos(x)$ correspond to zeros of $\cot(x)$. All zeros of $\sin(x)$, which are in the denominator, correspond to vertical asymptotes of $\cot(x)$.

Graph of y = cot(x)

Sketching Tangent and Cotangent Functions: Examples with Detailed Solutions

Example 1: Graphing a Transformed Tangent Function

Sketch the graph of $y = \tan\left( 2x + \dfrac{\pi}{2} \right)$ over one period.


Solution:

Graphing Parameters

Range: $(- \infty , +\infty)$

Period: Calculate using the tangent base period $\pi$:

$$ \dfrac{\pi}{|k|} = \dfrac{\pi}{2} $$

Vertical Asymptotes: Occur where the inside of the tangent function equals the base asymptotes $\dfrac{\pi}{2} + k\pi$:

$$ 2x + \dfrac{\pi}{2} = \dfrac{\pi}{2} + k\pi $$

Which simplifies to:

$$ 2x = k\pi \implies x = \dfrac{k\pi}{2}, \quad k = 0, \pm 1, \pm 2, \ldots $$

Horizontal Shift: The horizontal shift due to $\dfrac{\pi}{2}$ allows rewriting the function by factoring out the $2$:

$$ y = \tan \left[ 2 \left( x + \dfrac{\pi}{4} \right) \right] $$

This means the graph shifts $\dfrac{\pi}{4}$ units to the left.

Two steps to graph the function $y = \tan\left( 2x + \dfrac{\pi}{2} \right)$:

1) Sketch $\tan(2x)$ over one period from $0$ to $\dfrac{\pi}{2}$ (blue graph below).

2) Then sketch $y = \tan \left[ 2 \left( x + \dfrac{\pi}{4} \right) \right]$ by translating the previous graph $\dfrac{\pi}{4}$ to the left (red graph below), making the period start at $- \dfrac{\pi}{4}$ and end at $\dfrac{\pi}{4}$, which is one full period of $\dfrac{\pi}{2}$.

Graph of y = tan(2x + π/2)
Example 2: Graphing a Transformed Cotangent Function

Sketch the graph of $y = \cot \left( 4x - \dfrac{\pi}{4} \right)$ over one period.


Solution:

Graphing Parameters

Range: $(- \infty , +\infty)$

Period: Calculate using the cotangent base period $\pi$:

$$ \dfrac{\pi}{|k|} = \dfrac{\pi}{4} $$

Vertical Asymptotes: Found by solving for when the inside of the cotangent function equals $k\pi$:

$$ 4x - \dfrac{\pi}{4} = k \pi $$

Which gives:

$$ 4x = k\pi + \dfrac{\pi}{4} \implies x = \dfrac{k \pi + \dfrac{\pi}{4}}{4}, \quad k = 0, \pm 1, \pm 2, \ldots $$

Horizontal Shift: The horizontal shift due to $- \dfrac{\pi}{4}$ can be identified by factoring out the $4$:

$$ y = \cot \left[ 4 \left( x - \dfrac{\pi}{16} \right) \right] $$

This represents a shift of $\dfrac{\pi}{16}$ units to the right.

Two steps to graph the function $y = \cot \left( 4x - \dfrac{\pi}{4} \right)$:

1) Start by sketching $\cot(4x)$ over one period from $0$ to $\dfrac{\pi}{4}$ (blue graph).

2) Then sketch $y = \cot \left[ 4 \left( x - \dfrac{\pi}{16} \right) \right]$ by translating the graph $\dfrac{\pi}{16}$ to the right (red graph below), making the period start at $\dfrac{\pi}{16}$ and end at $\dfrac{5\pi}{16}$, which is one full period.

Graph of y = cot(4x - π/4)

More References and Links