GRAPHS OF TRIGONOMETRIC FUNCTIONS

Objectives: To learn about the graphs of trigonometric functions.

The graphs of the sine and cosine functions

A good way for human beings to understand a function is to look at its graph. Let's start with the graph of sin x. Take the horizontal axis to be the x-axis as usual, take the vertical axis to be the y-axis, and graph the equation y = sin x. It looks like this.

First, note that it is periodic of period 2pi. Geometrically, that means that if you take the curve and slide it 2pi either left or right, then the curve falls back on itself.
Second, note that the graph is within one unit of the x-axis. Not much else is obvious, except where it increases and decreases.

Next, let's look at the graph of cosine. Graph the equation y = cos x.

Note that it looks just like the graph of sin x except it's translated to the left by pi/2. That's because of the identity cos x = sin (pi/2 + x). This identity before easily follows from : cos x = cos( -x) = sin (pi/2 - (-x)) = sin (pi/2 + x).

Recall 1:  If you examine the function y = 3sin x, you will notice that it has a maximum value of 3 and a minimum value of -3.  In fact, if we replace the 3 by a constant, say A, to get the function y = A*sin x, you will notice that the largest value of y is A and the smallest is -A.  The constant A is called the amplitude  of the function.  The graph of y = 3 sin x is displayed below.

Recall 2:  The period of the graph is the interval over which the function repeats itself.

For example, the function y = sin 4x goes through four repeats between x = 0 and x = 2pi.  Therefore, its period is 2pi/4, or pi/2.  Its graph is illustrated below.

Recall 3  The same things that were said in the two previous "recalls" can be said for the cosine function y = A*cos (Bx), where A and B represent constant real numbers.   Below are two examples, y = cos 4x and y = 3cos x.

Recall 4 There are many natural phenomena that call for functions that repeat themselves.  Those functions are called periodic functions and the sine and cosine functions are just two of many that are periodic.
You can imagine many physical situations that call for periodic functions.  For example, the swing of a pendulum, the motion of a clock, the fluctuations of temperature in a day, waves, electric currents, etc.  In these cases the independent variable of the function is not an angle, but rather a length.  For example, the repeating pattern of a wave may be a function of time.  The repeating period of a pendulum may be thought of as a function of angle or a function of time.

Recall 5 Graphing calculators and computers make it easy to graph more complicated functions.  It may be easy to recall what the graph of sin x or cos x looks like, but if you are faced with trying to determine the picture of sin(2x) tan (4x) it may be a different story.   Here are some commands you should know when using any of the two computer algebra systems that we have on campus.

In Mathematica
To graph a function f(x) between values x = a and x = b in Mathematica, the command is

Plot[F[x],{x,a,b}];

Note:  All commands in Mathematica have their first letters capitalized. Square brackets [ ] enclose the specifics of the command. For example, to plot the function sin x, type: Plot[Sin[x],{x,0,2*Pi}];  and press the ENTER key.  (Remember that the RETURN key on a Macintosh is not the same as the ENTER key.)   The commands in Mathematica are case sensitive, so if you type in PI for Pi, the program will not know what you mean.
You can also graph more than one function on the same background.   Here is the syntax:

Plot[{F[x],G[x],H[x]},{x, a,b}];

So, for example,  Plot[{Sin[x],Cos[x]},{x,0,2*Pi}]; will display both the sine and cosine function from 0 to 2pi at the same time.

In Maple
Graphing in Maple is different.  The syntax for plotting a function f(x) from x = a to x = b is

plot(f(x), x=a..b);

Notice that there are no capitals and no square brackets.  For example, to graph the sine function from x = 0 to x = 2pi, type plot(sin(x), x=0..2*Pi); and press the ENTER key.

Multiple graphs can be displayed using the syntax plot({f(x),g(x),h(x)}, x=0..2*Pi);.  For example, to graph sin x and cos x from x = 0 to x = 2pi on the same background, type plot({sin(x),cos(x)}, x=0..2*Pi); and press the ENTER key.

Recall 6. The graphs of the tangent and cotangent functions

The graph of the tangent function has a vertical asymptote at x =pi /2. This is because the tangent approaches infinity as x approaches pi/2. (Actually, it approaches minus infinity as x approaches pi/2 from the right as you can see on the graph.

You can also see that tangent has period pi; there are also vertical asymptotes every pi units to the left and right. Algebraically, this periodicity is expressed by tan (x + pi ) = tan x.

The graph for cotangent is very similar.

This similarity is simply because the cotangent of x is the tangent of the complementary angle -x .

The graphs of the secant and cosecant functions

The secant is the reciprocal of the cosine, and as the cosine only takes values between -1 and 1, therefore the secant only takes values above 1 or below -1, as shown in the graph. Also secant has a period of 2*pi.

As you would expect by now, the graph of the cosecant looks much like the graph of the secant.

Examples

Example 1.   To graph the function

in Mathematica, type Plot[Cos[x]/(1-Sin[x])-Tan[x],{x,0,2*Pi}]; and press the ENTER key.  You should get the graph illustrated below.

Example 2.   Use graphs to find approximate solutions of the equation (sec x)^2 = 2tan x for -pi/2 <= x <= pi/2.

Solution:  Graph the function (sec x)^2 - 2tan x and zoom into the x value that makes the function 0.  Enter Plot[Sec[x]^2 - 2*Tan[x],{x,-Pi/2,Pi/2}];    You get the picture below.

From this picture it looks like the function (sec x)^2 - 2tan x is zero somewhere between x = -1 and x = 1.  Graph the function again, using the command Plot[Sec[x]^2 - 2*Tan[x],{x,-1,1}];.  You should get something like the graph below.

This last graph suggests that we should limit our search to the region where x is between 0.7 and 0.9.  So type Plot[Sec[x]^2 - 2*Tan[x],{x,0.7,0.9}]; to get something like the graph below.

You could continue to zoom into the graph below and conclude that the solution must be x = 0.7854

Compare this to the solution that you can get by direct algebraic analysis of the problem.  (We worked this out in Example 2 of topic no. 38 and found the solution to be pi/4 = 0.785398.)

EXERCISES

For problems 1 through 5, use a computer algebra system (or do it by hand !!) to display the graph of the function in question and find its period and amplitude.

1.  f(x) = 3*sin (2x^2)

2. f(x) = 3cos(x - pi)

3  f(x) = 4tan(x/2 + pi/4)

4 f(x) = (1 + cos x)(csc x - cot x)

5 f(x) = (cos x + sin x)^2 - 1

6 Graph tan x and cot x on the same background, where x ranges from -2pi to 2pi.

7 Graph sec x and cos x on the same b background, where x ranges from -2pi to 2pi.

8 Graph sin x and csc x on the same b background, where x ranges from -2pi to 2pi.

9 Graph y = cos x, y = cos 3x and y = -0.5 cos 3x an the same background, where x ranges from -2pi to 2pi.

10 Use graphs to find the approximate solutions to the equation cos x = cos (x/2), where x is between 0 and 2pi.

11 Use graphs to find the approximate solutions to the equation sin x = 2cos x, where x = 0 and 2pi.

12 Find an approximate solution to the equation 2sin 2x + 3cos x = 0 for 0 <=x <= pi.