4. Graphs of tan, cot, sec and csc

by M. Bourne

The graphs of `tan x`, `cot x`, `sec x` and `csc x` are not as common as the sine and cosine curves that we met earlier in this chapter. However, they do occur in engineering and science problems.

They are interesting curves because they have discontinuities. For certain values of x, the tangent, cotangent, secant and cosecant curves are not defined, and so there is a gap in the curve.

[For more on this topic, go to Continuous and Discontinuous Functions in an earlier chapter.]

Recall from Trigonometric Functions, that `tan x` is defined as:

`tan x=(sin x)/(cos x)`

Consider the denominator (bottom) of this fraction. For some values of x, the function `cos x` has value `0`. For example, when `x=pi/2`, the value of `cos {:π/2:}` is `0`, and when `x=(3pi)/2`, we have `cos{:(3π)/2:}=0`.

When this happens, we have `0` in the denominator of the fraction and this means the fraction is undefined. So there will be a "gap" in the function at that point. This gap is called a discontinuity.

The same thing happens with `cot x`, `sec x` and `csc x` for different values of `x`. For each one, the denominator will have value `0` for certain values of x.

The Graph of y = tan x

Sketch y = tan x.


As we saw above,

`tan x=(sin x)/(cos x)`

This means the function will have a discontinuity where cos x = 0. That is, when x takes any of the values:

`x = ..., -(5π)/2, -(3π)/2, -π/2,` ` π/2,` ` (3π)/2,` ` (5π)/2, ...`

It is very important to keep these values in mind when sketching this graph.

When setting up a table of values, make sure you include `x`-values either side of the discontinuities.

Recall that `-(3pi)/2=-4.7124` and `-pi/2= -1.5708`. So we take values quite near these discontinuities.

tan x-80.7-4.6-1.2-0.370108-92-1.600.551.614.11,256

Notice that either side of `-pi/2`, (our values of -1.58 and -1.56 in the table above), we jump from a large positive number (108), to a small negative number (-92).

If we continue our table, we will get similar values (because this is a periodic graph). So we are ready to sketch our curve.

Graph of y = tan x:

Note that there are vertical asymptotes (the gray dotted lines) where the denominator of `tan x` has value zero.

(An asymptote is a straight line that the curve gets closer and closer to, without actually touching it. You can see more examples of asymptotes in a later chapter, Curve Sketching Using Differentiation.)

Note also that the graph of `y = tan x` is periodic with period π. This means it repeats itself after each π as we go left to right on the graph.

Interactive Tangent Animation

You can see an animation of the tangent function in this interactive.

Things to do

Using the sliders below the graph, you can change:

  1. The amount of energy in the wave by changing the amplitude, a
  2. The frequency the wave by changing b
  3. The phase shift of the wave by changing c
  4. The vertical displacement of the wave by changing d

The units on the horizontal x-axis are radians (in decimal form). Recall that:

π radians = 3.14 radians = 180°.

So the (initial) graph shown is from `-pi/2` to `(7pi)/2`. The vertical dashed lines are the asymptotes.

The pink triangle that appears when you start the animation has base length = 1. The height of that triangle is the tan ratio of the current angle. You may notice the hypotenuse of the triangle is almost vertical when the graph goes off to ±∞.

Graph: y = a tan(bx + c) + d = tan(x)

(x, y) =


Copyright © www.intmath.com Frame rate: 0

(For more on periodic functions and to see `y = tan x` using degrees, rather than radians, see Trigonometric Functions of Any Angle.)

The Graph of y = cot x

Recall from Trigonometric Functions that:

`cot x=1/tanx = (cos x)/(sin x)`

We now have to consider when `sin x` has value zero, because this will determine where our asymptotes should go.

The function will have a discontinuity where `sin x = 0`, that is, when

` x = ..., -3π, -2π, -π, 0,` ` π,` ` 2π,` ` 3π,` ` 4π,` ` 5π, ...`

Considering the values of cos x and sin x for different values of x (or more simply, finding the values of `1/tanx`), we can set up a table of values. We can then sketch the graph of `y = cot x` as follows.

The Graph of y = sec x

We could laboriously draw up a table with millions of values, or we could work smart and recall that

`sec x=1/(cos x)`

We know the sketch for y = cos x and we can easily derive the sketch for y = sec x, by finding the reciprocal of each y-value. (That is, finding `1/y` for each value of y on the curve `y = cos x`.)

For example (angles are in radians):

x = cos x 1/y = sec x
0 1 1
1 0.54 1.85
1.55 0.02 48.09
2 −0.42 −2.4
3 −0.99 −1.01
4 −0.65 −1.53

I included a value just less than `π/2=1.57` so that we could get an idea of what goes on there. When `cos x` is very small, `sec x` will be very large.

After applying this concept throughout the range of x-values, we can proceed to sketch the graph of `y = sec x`.

First, we graph `y = cos x` and then `y = sec x` immediately below it. Compare the y-values in each of the 2 graphs and assure yourself they are the reciprocal of each other.

y = cos x

y = sec x

We draw vertical asymptotes (the dashed lines) at the values where `y = sec x` is not defined. That is, when

`x = ..., -(5π)/2, -(3π)/2,` ` -π/2,` ` π/2,` ` (3π)/2,` ` (5π)/2, ...`

You will notice that these are the same asymptotes that we drew for `y = tan x`, which is not surprising, because they both have `cos x` on the bottom of the fraction.



y = csc x


We recall that

`csc x=1/(sin x)`

So we will have asymptotes where `sin x` has value zero, that is:

x = ..., -3π, -2π, -π, 0, π, 2π, 3π, 4π, ...

We draw the graph of y = sin x first and indicate with dashed lines where the graph has value `0`:

Next, we consider the reciprocals of all the y-values in the above graph (similar to what we did with the y = sec x table we created above).

`x` `y` `= sin x` `csc x` `= 1/(sin x)`
0.01 0.01 100
0.5 0.48 2.09
`pi/2` 1 1
2 0.91 1.10
3 0.14 7.09
3.1 0.04 24.05

I chose values close to `0` and `pi`, and some values in between. The pattern will be similar for the region from `pi` to `2pi` except it will be on the negative side of the axis.

We continue on both sides and realise the pattern will repeat. Now for the graph of y = csc x:

Easy to understand math videos:

You may also be interested in:

The next section in this chapter shows some Applications of Trigonometric Graphs.