DerivTrig.mws

Derivatives of Trigonometric Functions

>    restart;

>   

Auxiliary Procedures

>    DerivativeTable := proc( f, x, orders )
  local n, T;
  n := nops(orders);
  T := Matrix( n, 2, (i,j)->`if`(j=1,orders[i],diff(f,x$orders[i])) );
  return T
end proc:

>   

Lesson Overview

We now have all the tools necessary to differentiate trigonometric functions. The fundamental trigonometric functions are sine and cosine. Once the derivatives of these are known, the derivatives of tangent, secant, cotangent, and cosecant can be obtained with the Quotient, Power, and Chain Rules. Thus, our primary objective is to find the derivative of sine and cosine. This will be done via the definition and will involve the two special limits from the Limits of Trigonometric Functions lesson. Additional examples will provide additional practice with all of the Derivative Rules, including the Chain Rule.

The DerivativePlot  maplet [ Maplet Viewer][ MapleNet] is introduced as a useful tool for creating a plot of a function and one or more of its derivatives. The Differentiation  maplet [ Maplet Viewer] [ MapleNet] continues to be a useful tool for practicing the use of the Differentiation Rules. But, do not become dependent upon these maplets --- be sure you can find derivatives by hand!

>   

Derivatives of the Sine and Cosine Functions

Graphs of the sine and cosine functions are continuous and have a tangent line at all points. This means the sine and cosine functions should be differentiable everywhere.

To form a picture of the derivative of the sine function, use the DerivativePlot  maplet [ Maplet Viewer][ MapleNet]. Launch this maplet, then set the Function  to be sin(x) , a = -2*Pi , b= 2*Pi , and orders= 1  then click Plot . The graph of the derivative of the sine function looks familiar --- with a period of 2*Pi , amplitude 1 with a maximum at x = 0  it looks like the cosine function. This leads to the conjecture:

  diff(sin(x),x) = cos(x)  

Now, change the Function  to cos(x)  and click Plot . The derivative of cosine has period 2*Pi , amplitude 1 with a zero at x = 0  and a minimum around x = 1.5  and another zero around x = 3 ; this sounds like the negative of the cosine function. Based on this we conjecture:

  diff(cos(x),x) = -sin(x)  

To determine if these conjectures are correct, turn to the definition of the derivative:

  diff(sin(x),x) = limit((sin(x+h)-sin(x))/h,h = 0)                                              

  `` = limit((sin(x)*cos(h)+cos(x)*sin(h)-sin(x))/h,h = 0)  

  `` = limit(sin(x)*(cos(h)-1)/h+cos(x)*sin(h)/h,h = 0)     

               `` = sin(x)*limit((cos(h)-1)/h,h = 0)+cos(x)*limit(sin(h)/h,h = 0)  

  `` = sin(x)*0+cos(x)*1                                              

  `` = cos(x)                                                                 

  diff(cos(x),x) = limit((cos(x+h)-cos(x))/h,h = 0)                                              

  `` = limit((cos(x)*cos(h)-sin(x)*sin(h)-cos(x))/h,h = 0)  

  `` = limit(cos(x)*(cos(h)-1)/h-sin(x)*sin(h)/h,h = 0)     

               `` = cos(x)*limit((cos(h)-1)/h,h = 0)-sin(x)*limit(sin(h)/h,h = 0)  

  `` = cos(x)*0-sin(x)*1                                              

  `` = -sin(x)                                                                 

You should now understand why we spent so much time in the Limits of Trigonometric Functions lesson looking at the two special limits:

  limit(sin(theta)/theta,theta = 0) = 1   and   limit((1-cos(theta))/theta,theta = 0) = 0  

Because of the way the derivatives of sine and cosine are related it should be interesting to look at the higher-order derivatives of these functions.

>    DerivativeTable( sin(x), x, [$1..8] ),
DerivativeTable( cos(x), x, [$1..8] );

Matrix(%id = 22751624), Matrix(%id = 22775712)

Thus, higher-order derivatives of sine and cosine are cyclic (with period 4).

>   

Derivatives of Other Trigonometric Functions

The derivatives of the sine and cosine function together with the Quotient, Power, and Chain Rules are all that is needed to discover the derivatives of tangent, secant, cotangent, and cosecant.

First, for the tangent function:

  diff(tan(x),x) = diff(sin(x)/cos(x),x)                         

                                     `` = (cos(x)*diff(sin(x),x)-sin(x)*diff(cos(x),x))/(cos(x)^2)  

                         `` = (cos(x)*cos(x)-sin(x)*(-sin(x)))/(cos(x)^2)  

  `` = (cos(x)^2+sin(x)^2)/(cos(x)^2)  

  `` = 1/(cos(x)^2)                   

  `` = sec(x)^2  .                   

>   

The derivative of the secant function can be found with the Power and Chain Rules:

  diff(sec(x),x) = diff(1/cos(x),x)                   

  `` = diff(cos(x)^(-1),x)  

                            `` = (-1)*cos(x)^(-2)*diff(cos(x),x)  

                       `` = (-1)*cos(x)^(-2)*(-sin(x))  

  `` = sin(x)/(cos(x)^2)           

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

  `` = sec(x)*tan(x)  

Note the use of the Chain Rule in this derivation.

>   

The derivatives of the cotangent and cosecant functions can be similarly derived.

All six trigonometric derivatives are summarized in the table below.

  MATRIX([[diff(sin(x),x) = cos(x), diff(cos(x),x) = -sin(x)], [diff(tan(x),x) = sec(x)^2, diff(cot(x),x) = -csc(x)^2], [diff(sec(x),x) = sec(x)*tan(x), diff(csc(x),x) = -csc(x)*cot(x)]])  

A comparison of the entries in the first column with the corresponding entry in the second column of the table reveals a relationship between the derivatives of a trigonometric function and its ``co'' function:

 change the sign and change all functions to their co-function.

For this reason it is not essential that you memorize the derivatives of cotangent and cosecant.

Examples

You are strongly encouraged to use the Differentiation  maplet [ Maplet Viewer] [ MapleNet] to follow each step of the differentiation in each example.

Example 1: diff(cos(Pi*t/180),t)  

This derivative is computed using the Chain Rule:

  diff(cos(Pi*t/180),t) = -sin(Pi*t/180)*diff(Pi*t/180,t)  

         `` = -sin(Pi*t/180)*Pi/180  

          `` = -Pi/180   sin(Pi*t/180)  

>   

Confirmation of this result with Maple is obtained as follows:

>    f1 := cos( Pi*t/180 ):
df1 := Diff( f1, t ):
df1 = value( df1 );

Diff(cos(1/180*Pi*t),t) = -1/180*sin(1/180*Pi*t)*Pi

The factor Pi/180  in this function converts an angle from degrees to radians. This result shows that this factor also relates the rate of change of the cosine of an angle measured in radians to the rate of change of the cosine of an angle measured in degrees.

>   

Example 2: diff((cos(u)/sin(2*u))^2,u)  

  diff((cos(u)/sin(2*u))^2,u) = 2*cos(u)/sin(2*u)*diff(cos(u)/sin(2*u),u)                                             

                               `` = 2*cos(u)/sin(2*u)   (sin(2*u)*diff(cos(u),u)-cos(u)*diff(sin(2*u),u))/(sin(2*u)^2)  

                           `` = 2*(cos(u)/sin(2*u))(sin(2*u)*(-sin(u)-cos(u)*2*cos(2*u))/(sin(2*u)^2))  

                  `` = -2*cos(u)*(sin(2*u)*sin(u)+2*cos(u)*cos(2*u))/(sin(2*u)^3)  

To simplify this answer further use the double angle formulae:

  sin(2*u) = 2*sin(u)*cos(u)     and     cos(2*u) = cos(u)^2-sin(u)^2  .

These yield

  diff((cos(u)/sin(2*u))^2,u) = -2*cos(u)*(2*sin(u)*cos(u)*sin(u)+2*cos(u)*(cos(u)^2-sin(u)^2))/(sin(2*u)^3)  

  `` = -4*cos(u)^2*(sin(u)^2+cos(u)^2-sin(u)^2)/(sin(2*u)^3)  

  `` = -4*cos(u)^2*cos(u)^2/(sin(2*u)^3)  

  `` = -4*cos(u)^4/(sin(2*u)^3)  

Further simplifications are possible with another application of the double angle formula for sine:

  diff((cos(u)/sin(2*u))^2,u) = -4*cos(u)^4/(sin(2*u)^3)                                           

  `` = -4*cos(u)^4/((2*sin(u)*cos(u))^3)  

  `` = -4*cos(u)^4/(8*sin(u)^3*cos(u)^3)    

  `` = -cos(u)/(2*sin(u)^3)                  

In hindsight, note that the function to be differentiated can be simplified using the double angle formula for sine.

  (cos(u)/sin(2*u))^2 = (cos(u)/(2*sin(u)*cos(u)))^2  

                 `` = 1/((2*sin(u))^2)  

                            `` = 1/4   sin(u)^(-2)  

                       `` = 1/4   csc(u)^2  

Use the Differentiation  maplet [ Maplet Viewer] [ MapleNet] to verify the derivative of this expression agrees with the previous results of this example.

To use Maple to confirm the manual computations above it will be necessary to explicitly tell Maple which trigonometric identities to use at various points along the way. We begin by entering these identities:

>    id1 := u->cos(u)^2=1-sin(u)^2:
id2 := u->sin(2*u)=2*sin(u)*cos(u):
id3 := u->cos(2*u)=cos(u)^2-sin(u)^2:
id1(u);
id2(u);
id3(u);

cos(u)^2 = 1-sin(u)^2

sin(2*u) = 2*sin(u)*cos(u)

cos(2*u) = cos(u)^2-sin(u)^2

The derivative of the function in its original form is

>    f2 := ( cos(u)/sin(2*u) )^2:
df2a := Diff( f2, u ):
df2a = value( df2a );

Diff(cos(u)^2/sin(2*u)^2,u) = -2*cos(u)/sin(2*u)^2*sin(u)-4*cos(u)^2/sin(2*u)^3*cos(2*u)

Combining the two terms on right-hand side yields

>    df2b := simplify( value(df2a) ):
df2a = df2b;

Diff(cos(u)^2/sin(2*u)^2,u) = 4*cos(u)^4/sin(2*u)/(-1+cos(2*u)^2)

Maple's result takes this form because Maple ``simplified'' sin(2*u)^3  to sin(2*u)*(1-cos(2*u)^2) . To undo this step, use Maple's simplify  command with a side relation . The result is

>    df2c := simplify( df2b, [id1(u)] ):
df2a = df2c;

Diff(cos(u)^2/sin(2*u)^2,u) = -1/2*cos(u)/sin(u)^3

Which agrees with the result obtained manually.

When the double angle formula for sine is applied to the function prior to differentiation:

>    f2a := simplify( f2, [id2(u)] ):
f2 = f2a;

cos(u)^2/sin(2*u)^2 = 1/4*1/(sin(u)^2)

and so

>    df2d := diff( f2a, u ):
df2a = df2d;

Diff(cos(u)^2/sin(2*u)^2,u) = -1/2*cos(u)/sin(u)^3

>   

Example 3: diff(sin(theta)*tan(theta^2),theta)  

Note that the second term is tan(theta^2) , not tan(theta)^2 .

This derivative can be found using the Product and Chain Rules:

  diff(sin(theta)*tan(theta^2),theta) = diff(sin(theta),theta)*tan(theta^2)+sin(theta)*diff(tan(theta^2),theta)                      

                   `` = cos(theta)*tan(theta^2)+sin(theta)*(-sec(theta^2)*diff(theta^2,theta))  

  `` = cos(theta)*tan(theta^2)-2*theta*sin(theta)*sec(theta^2)  

Computation of this derivative in Maple could be done as follows:

>    f3 := sin(theta)*tan(theta^2):
df3 := Diff( f3, theta ):
df3 = value( df3 );

Diff(sin(theta)*tan(theta^2),theta) = cos(theta)*tan(theta^2)+2*sin(theta)*(1+tan(theta^2)^2)*theta

This answer differs from ours in appearance only. Note that Maple reports

>    q1 := Diff( tan(x), x ):
q1 = value( q1 );

Diff(tan(x),x) = 1+tan(x)^2

To force Maple to replace powers of tangent with secant we supply a fourth trigonometric identity:

>    id4 := u->tan(u)^2=sec(u)^2-1:
id4(x);

tan(x)^2 = sec(x)^2-1

Then, supplying this identity to simplify  as a side relation :

>    q1 = simplify( value(q1), [id4(x)] );

Diff(tan(x),x) = sec(x)^2

Applying this same approach to this example,

>    df3 = simplify( value(df3), [id4(theta^2)] );

Diff(sin(theta)*tan(theta^2),theta) = cos(theta)*tan(theta^2)+2*sin(theta)*theta*sec(theta^2)^2

Except for the unfortunate separation of the terms in the 2*theta  factor, this is exactly our result.

>   

Lesson Summary

The trigonometric functions are differentiable at all points in their domain. The derivatives of the fundamental functions are

MATRIX([[diff(sin(x),x) = cos(x), diff(cos(x),x) = -sin(x)], [diff(tan(x),x) = sec(x)^2, diff(cot(x),x) = -csc(x)^2], [diff(sec(x),x) = sec(x)*tan(x), diff(csc(x),x) = -csc(x)*cot(x)]])  

>   

What's Next?

By now you should be very comfortable using the Differentiation  maplet [ Maplet Viewer] [ MapleNet] to check your work. While this tool is useful and powerful, remember that you must also develop your manual skills. After correctly answering a few of the online practice problems, complete the textbook homework assignment and the online homework assignment.

In the Implicit Differentiation lesson the Power Rule will be verified for all rational exponents and we will learn how to find the slope of the tangent line to any curve - not just the graph of a function. This will conclude the unit on differentiation.

>   

>   

>