### Learning Objectives

• Find the derivatives of the sine and cosine function.
• Find the derivatives of the standard trigonometric functions.
• Calculate the higher-order derivatives of the sine and cosine.

One of the most important types of motion in physics is simple harmonic motion, which is associated with such systems as an object with mass oscillating on a spring. Simple harmonic motion can be described by using either sine or cosine functions. In this section we expand our knowledge of derivative formulas to include derivatives of these and other trigonometric functions. We begin with the derivatives of the sine and cosine functions and then use them to obtain formulas for the derivatives of the remaining four trigonometric functions. Being able to calculate the derivatives of the sine and cosine functions will enable us to find the velocity and acceleration of simple harmonic motion.

# Derivatives of the Sine and Cosine Functions

We begin our exploration of the derivative for the sine function by using the formula to make a reasonable guess at its derivative. Recall that for a function $f(x),$

$f^{\prime}(x)=\underset{h\to 0}{\lim}\frac{f(x+h)-f(x)}{h}$.

Consequently, for values of $h$ very close to 0, $f^{\prime}(x)\approx \frac{f(x+h)-f(x)}{h}$. We see that by using $h=0.01$,

$\frac{d}{dx}(\sin x)\approx \frac{\sin(x+0.01)-\sin x}{0.01}$

By setting $D(x)=\frac{\sin(x+0.01)-\sin x}{0.01}$ and using a graphing utility, we can get a graph of an approximation to the derivative of $\sin x$ ( (Figure) ).

Upon inspection, the graph of $D(x)$ appears to be very close to the graph of the cosine function. Indeed, we will show that

$\frac{d}{dx}(\sin x)= \cos x$.

If we were to follow the same steps to approximate the derivative of the cosine function, we would find that

$\frac{d}{dx}(\cos x)=-\sin x$.

### The Derivatives of $\sin x$ and $\cos x$

The derivative of the sine function is the cosine and the derivative of the cosine function is the negative sine.

$\frac{d}{dx}(\sin x)= \cos x$
$\frac{d}{dx}(\cos x)=-\sin x$

## Proof

Because the proofs for $\frac{d}{dx}(\sin x)= \cos x$ and $\frac{d}{dx}(\cos x)=-\sin x$ use similar techniques, we provide only the proof for $\frac{d}{dx}(\sin x)= \cos x$. Before beginning, recall two important trigonometric limits we learned in Introduction to Limits :

$\underset{h\to 0}{\lim}\frac{\sin h}{h}=1$ and $\underset{h\to 0}{\lim}\frac{\cos h-1}{h}=0$.

The graphs of $y=\frac{\sin h}{h}$ and $y=\frac{(\cos h-1)}{h}$ are shown in (Figure) .

We also recall the following trigonometric identity for the sine of the sum of two angles:

$\sin(x+h)= \sin x \cos h+ \cos x \sin h$.

Now that we have gathered all the necessary equations and identities, we proceed with the proof.

$\begin{array}{lllll}\frac{d}{dx} \sin x & =\underset{h\to 0}{\lim}\frac{\sin(x+h)-\sin x}{h} & & & \text{Apply the definition of the derivative.} \\ & =\underset{h\to 0}{\lim}\frac{\sin x \cos h+ \cos x \sin h- \sin x}{h} & & & \text{Use trig identity for the sine of the sum of two angles.} \\ & =\underset{h\to 0}{\lim}(\frac{\sin x \cos h-\sin x}{h}+\frac{\cos x \sin h}{h}) & & & \text{Regroup.} \\ & =\underset{h\to 0}{\lim}(\sin x(\frac{\cos h-1}{h})+ \cos x(\frac{\sin h}{h})) & & & \text{Factor out} \, \sin x \, \text{and} \, \cos x. \\ & = \sin x(0)+ \cos x(1) & & & \text{Apply trig limit formulas.} \\ & = \cos x & & & \text{Simplify.} \end{array} _\blacksquare$

(Figure) shows the relationship between the graph of $f(x)= \sin x$ and its derivative $f^{\prime}(x)= \cos x$. Notice that at the points where $f(x)= \sin x$ has a horizontal tangent, its derivative $f^{\prime}(x)= \cos x$ takes on the value zero. We also see that where $f(x)= \sin x$ is increasing, $f^{\prime}(x)= \cos x < 0$ and where $f(x)= \sin x$ is decreasing, $f^{\prime}(x)= \cos x < 0$.

### Differentiating a Function Containing $\sin x$

Find the derivative of $f(x)=5x^3 \sin x$.

#### Solution

Using the product rule, we have

$\begin{array}{ll}f^{\prime}(x) & =\frac{d}{dx}(5x^3)\cdot \sin x+\frac{d}{dx}(\sin x)\cdot 5x^3 \\ & =15x^2\cdot \sin x+ \cos x\cdot 5x^3\end{array}$

After simplifying, we obtain

$f^{\prime}(x)=15x^2 \sin x+5x^3 \cos x$.

Find the derivative of $f(x)= \sin x \cos x.$

#### Hint

Don’t forget to use the product rule.

#### Solution

$f^{\prime}(x)=\cos^2 x-\sin^2 x$

### Finding the Derivative of a Function Containing $\cos x$

Find the derivative of $g(x)=\frac{\cos x}{4x^2}$.

#### Solution

By applying the quotient rule, we have

$g^{\prime}(x)=\frac{(-\sin x)4x^2-8x(\cos x)}{(4x^2)^2}$.

Simplifying, we obtain

$\begin{array}{ll}g^{\prime}(x) & =\frac{-4x^2 \sin x-8x \cos x}{16x^4} \\ & =\frac{-x \sin x-2 \cos x}{4x^3} \end{array}$

Find the derivative of $f(x)=\frac{x}{\cos x}$.

#### Hint

Use the quotient rule.

#### Solution

$\frac{\cos x+x \sin x}{\cos^2 x}$

### An Application to Velocity

A particle moves along a coordinate axis in such a way that its position at time $t$ is given by $s(t)=2 \sin t-t$ for $0\le t\le 2\pi$. At what times is the particle at rest?

#### Solution

To determine when the particle is at rest, set $s^{\prime}(t)=v(t)=0$. Begin by finding $s^{\prime}(t)$. We obtain

$s^{\prime}(t)=2 \cos t-1$,

so we must solve

$2 \cos t-1=0$ for $0\le t\le 2\pi$.

The solutions to this equation are $t=\frac{\pi}{3}$ and $t=\frac{5\pi}{3}$. Thus the particle is at rest at times $t=\frac{\pi}{3}$ and $t=\frac{5\pi}{3}$.

A particle moves along a coordinate axis. Its position at time $t$ is given by $s(t)=\sqrt{3}t+2 \cos t$ for $0\le t\le 2\pi$. At what times is the particle at rest?

#### Hint

Use the previous example as a guide.

#### Solution

$t=\frac{\pi}{3}, \, t=\frac{2\pi}{3}$

# Derivatives of Other Trigonometric Functions

Since the remaining four trigonometric functions may be expressed as quotients involving sine, cosine, or both, we can use the quotient rule to find formulas for their derivatives.

### The Derivative of the Tangent Function

Find the derivative of $f(x)= \tan x$.

#### Solution

Start by expressing $\tan x$ as the quotient of $\sin x$ and $\cos x$:

$f(x)= \tan x=\frac{\sin x}{\cos x}$.

Now apply the quotient rule to obtain

$f^{\prime}(x)=\frac{\cos x \cos x-(-\sin x)\sin x}{(\cos x)^2}$.

Simplifying, we obtain

$f^{\prime}(x)=\frac{\cos^2 x+\sin^2 x}{\cos^2 x}$.

Recognizing that $\cos^2 x+\sin^2 x=1$, by the Pythagorean Identity, we now have

$f^{\prime}(x)=\frac{1}{\cos^2 x}$.

Finally, use the identity $\sec x=\frac{1}{\cos x}$ to obtain

$f^{\prime}(x)=\sec^2 x$.

Find the derivative of $f(x)= \cot x$.

#### Hint

Rewrite $\cot x$ as $\frac{\cos x}{\sin x}$ and use the quotient rule.

#### Solution

$f^{\prime}(x)=-\csc^2 x$

The derivatives of the remaining trigonometric functions may be obtained by using similar techniques. We provide these formulas in the following theorem.

### Derivatives of $\tan x, \, \cot x, \, \sec x$, and $\csc x$

The derivatives of the remaining trigonometric functions are as follows:

$\frac{d}{dx}(\tan x)=\sec^2 x$
$\frac{d}{dx}(\cot x)=-\csc^2 x$
$\frac{d}{dx}(\sec x)= \sec x \tan x$
$\frac{d}{dx}(\csc x)=-\csc x \cot x$

### Finding the Equation of a Tangent Line

Find the equation of a line tangent to the graph of $f(x)= \cot x$ at $x=\frac{\pi}{4}$.

#### Solution

To find the equation of the tangent line, we need a point and a slope at that point. To find the point, compute

$f(\frac{\pi}{4})= \cot \frac{\pi}{4}=1$.

Thus the tangent line passes through the point $(\frac{\pi}{4},1)$. Next, find the slope by finding the derivative of $f(x)= \cot x$ and evaluating it at $\frac{\pi}{4}$:

$f^{\prime}(x)=-\csc^2 x$ and $f^{\prime}(\frac{\pi}{4})=-\csc^2 (\frac{\pi}{4})=-2$.

Using the point-slope equation of the line, we obtain

$y-1=-2(x-\frac{\pi}{4})$

or equivalently,

$y=-2x+1+\frac{\pi}{2}$.

### Finding the Derivative of Trigonometric Functions

Find the derivative of $f(x)= \csc x+x \tan x.$

#### Solution

To find this derivative, we must use both the sum rule and the product rule. Using the sum rule, we find

$f^{\prime}(x)=\frac{d}{dx}(\csc x)+\frac{d}{dx}(x \tan x)$.

In the first term, $\frac{d}{dx}(\csc x)=-\csc x \cot x$, and by applying the product rule to the second term we obtain

$\frac{d}{dx}(x \tan x)=(1)(\tan x)+(\sec^2 x)(x)$.

Therefore, we have

$f^{\prime}(x)=-\csc x \cot x+ \tan x+x \sec^2 x$.

Find the derivative of $f(x)=2 \tan x-3 \cot x$.

#### Hint

Use the rule for differentiating a constant multiple and the rule for differentiating a difference of two functions.

#### Solution

$f^{\prime}(x)=2 \sec^2 x+3 \csc^2 x$

Find the slope of the line tangent to the graph of $f(x)= \tan x$ at $x=\frac{\pi}{6}$.

#### Hint

Evaluate the derivative at $x=\frac{\pi}{6}$.

#### Solution

$\frac{4}{3}$

# Higher-Order Derivatives

The higher-order derivatives of $\sin x$ and $\cos x$ follow a repeating pattern. By following the pattern, we can find any higher-order derivative of $\sin x$ and $\cos x$.

### Finding Higher-Order Derivatives of $y= \sin x$

Find the first four derivatives of $y= \sin x$.

#### Solution

Each step in the chain is straightforward:

$\begin{array}{lll} y & = & \sin x \\ \frac{dy}{dx} & = & \cos x \\ \frac{d^2 y}{dx^2} & = & -\sin x \\ \frac{d^3 y}{dx^3} & = & -\cos x \\ \frac{d^4 y}{dx^4} & = & \sin x \end{array}$

#### Analysis

Once we recognize the pattern of derivatives, we can find any higher-order derivative by determining the step in the pattern to which it corresponds. For example, every fourth derivative of $\sin x$ equals $\sin x$, so

$\begin{array}{l}\frac{d^4}{dx^4}(\sin x)=\frac{d^8}{dx^8}(\sin x)=\frac{d^{12}}{dx^{12}}(\sin x)=\cdots =\frac{d^{4n}}{dx^{4n}}(\sin x)= \sin x \\ \frac{d^5}{dx^5}(\sin x)=\frac{d^9}{dx^9}(\sin x)=\frac{d^{13}}{dx^{13}}(\sin x)=\cdots =\frac{d^{4n+1}}{dx^{4n+1}}(\sin x)= \cos x\end{array}$

For $y= \cos x$, find $\frac{d^4 y}{dx^4}$.

#### Hint

See the previous example.

#### Solution

$\cos x$

### Using the Pattern for Higher-Order Derivatives of $y= \sin x$

Find $\frac{d^{74}}{dx^{74}}(\sin x)$.

#### Solution

We can see right away that for the 74th derivative of $\sin x, \, 74=4(18)+2$, so

$\frac{d^{74}}{dx^{74}}(\sin x)=\frac{d^{72+2}}{dx^{72+2}}(\sin x)=\frac{d^2}{dx^2}(\sin x)=-\sin x$.

For $y= \sin x$, find $\frac{d^{59}}{dx^{59}}(\sin x)$.

#### Hint

$\frac{d^{59}}{dx^{59}}(\sin x)=\frac{d^{4(14)+3}}{dx^{4(14)+3}}(\sin x)$

#### Solution

$-\cos x$

### An Application to Acceleration

A particle moves along a coordinate axis in such a way that its position at time $t$ is given by $s(t)=2- \sin t$. Find $v(\pi/4)$ and $a(\pi/4)$. Compare these values and decide whether the particle is speeding up or slowing down.

First find $v(t)=s^{\prime}(t)$: $v(t)=s^{\prime}(t)=-\cos t$. Thus, $v(\frac{\pi}{4})=-\frac{1}{\sqrt{2}}$. Next, find $a(t)=v^{\prime}(t)$. Thus, $a(t)=v^{\prime}(t)= \sin t$ and we have $a(\frac{\pi}{4})=\frac{1}{\sqrt{2}}$. Since $v(\frac{\pi}{4})=-\frac{1}{\sqrt{2}} < 0$ and $a(\frac{\pi}{4})=\frac{1}{\sqrt{2}} < 0$, we see that velocity and acceleration are acting in opposite directions; that is, the object is being accelerated in the direction opposite to the direction in which it is travelling. Consequently, the particle is slowing down.

A block attached to a spring is moving vertically. Its position at time $t$ is given by $s(t)=2 \sin t$. Find $v(\frac{5\pi}{6})$ and $a(\frac{5\pi}{6})$. Compare these values and decide whether the block is speeding up or slowing down.

#### Hint

Use (Figure) as a guide.

#### Solution

$v(\frac{5\pi}{6})=-\sqrt{3} < 0$ and $a(\frac{5\pi}{6})=-1 < 0$. The block is speeding up.

### Key Concepts

• We can find the derivatives of $\sin x$ and $\cos x$ by using the definition of derivative and the limit formulas found earlier. The results are
$\frac{d}{dx} \sin x= \cos x$ and $\frac{d}{dx} \cos x=-\sin x$.
• With these two formulas, we can determine the derivatives of all six basic trigonometric functions.

# Key Equations

• Derivative of sine function
$\frac{d}{dx}(\sin x)= \cos x$
• Derivative of cosine function
$\frac{d}{dx}(\cos x)=-\sin x$
• Derivative of tangent function
$\frac{d}{dx}(\tan x)=\sec^2 x$
• Derivative of cotangent function
$\frac{d}{dx}(\cot x)=-\csc^2 x$
• Derivative of secant function
$\frac{d}{dx}(\sec x)= \sec x \tan x$
• Derivative of cosecant function
$\frac{d}{dx}(\csc x)=-\csc x \cot x$

For the following exercises, find $\frac{dy}{dx}$ for the given functions.

1.  $y=x^2- \sec x+1$

#### Solution

$\frac{dy}{dx}=2x- \sec x \tan x$

2.  $y=3 \csc x+\frac{5}{x}$

3.  $y=x^2 \cot x$

#### Solution

$\frac{dy}{dx}=2x \cot x-x^2 \csc^2 x$

4.  $y=x-x^3 \sin x$

5.  $y=\frac{\sec x}{x}$

#### Solution

$\frac{dy}{dx}=\frac{x \sec x \tan x- \sec x}{x^2}$

6.  $y= \sin x \tan x$

7.  $y=(x+ \cos x)(1- \sin x)$

#### Solution

$\frac{dy}{dx}=(1- \sin x)(1- \sin x)- \cos x(x+ \cos x)$

8.  $y=\frac{\tan x}{1- \sec x}$

9.  $y=\frac{1- \cot x}{1+ \cot x}$

#### Solution

$\frac{dy}{dx}=\frac{2 \csc^2 x}{(1+ \cot x)^2}$

10.  $y= \cos x(1+ \csc x)$

For the following exercises, find the equation of the tangent line to each of the given functions at the indicated values of $x$. Then use a calculator to graph both the function and the tangent line to ensure the equation for the tangent line is correct.

11. [T]  $f(x)=-\sin x, \, x=0$

#### Solution

$y=-x$

12. [T]  $f(x)= \csc x, \, x=\frac{\pi}{2}$

13. [T]  $f(x)=1+ \cos x, \, x=\frac{3\pi}{2}$

#### Solution

$y=x+\frac{2-3\pi}{2}$

14. [T]  $f(x)= \sec x, \, x=\frac{\pi}{4}$

15. [T]  $f(x)=x^2- \tan x, \, x=0$

$y=-x$

16. [T]  $f(x)=5 \cot x, \, x=\frac{\pi}{4}$

For the following exercises, find $\frac{d^2 y}{dx^2}$ for the given functions.

17.  $y=x \sin x- \cos x$

#### Solution

$\frac{d^2 y}{dx^2} = 3 \cos x-x \sin x$

18.  $y= \sin x \cos x$

19.  $y=x-\frac{1}{2} \sin x$

#### Solution

$\frac{d^2 y}{dx^2} = \frac{1}{2} \sin x$

20.  $y=\frac{1}{x}+ \tan x$

21.  $y=2 \csc x$

#### Solution

$\frac{d^2 y}{dx^2} = \csc (x)(3 \csc^2 x-1+ \cot^2 x)$

22.  $y=\sec^2 x$

23.  Find all $x$ values on the graph of $f(x)=-3 \sin x \cos x$ where the tangent line is horizontal.

#### Solution

$x = \frac{(2n+1)\pi}{4}$, where $n$ is an integer

24.  Find all $x$ values on the graph of $f(x)=x-2 \cos x$ for $0 < x < 2\pi$ where the tangent line has a slope of 2.

25.  Let $f(x)= \cot x$. Determine the point(s) on the graph of $f$ for $0 < x < 2\pi$ where the tangent line is parallel to the line $y=-2x$.

#### Solution

$(\frac{\pi}{4},1), \, (\frac{3\pi}{4},-1)$

26. [T] A mass on a spring bounces up and down in simple harmonic motion, modeled by the function $s(t)=-6 \cos t$ where $s$ is measured in inches and $t$ is measured in seconds. Find the rate at which the spring is oscillating at $t=5$ s.

27.  Let the position of a swinging pendulum in simple harmonic motion be given by $s(t)=a \cos t+b \sin t$. Find the constants $a$ and $b$ such that when the velocity is 3 cm/s, $s=0$ and $t=0$.

#### Solution

$a=0, \, b=3$

28.  After a diver jumps off a diving board, the edge of the board oscillates with position given by $s(t)=-5 \cos t$ cm at $t$ seconds after the jump.

1. Sketch one period of the position function for $t\ge 0$.
2. Find the velocity function.
3. Sketch one period of the velocity function for $t\ge 0$.
4. Determine the times when the velocity is 0 over one period.
5. Find the acceleration function.
6. Sketch one period of the acceleration function for $t\ge 0$.

29.  The number of hamburgers sold at a fast-food restaurant in Pasadena, California, is given by $y=10+5 \sin x$ where $y$ is the number of hamburgers sold and $x$ represents the number of hours after the restaurant opened at 11 a.m. until 11 p.m., when the store closes. Find $y^{\prime}$ and determine the intervals where the number of burgers being sold is increasing.

#### Solution

$y^{\prime}=5 \cos (x)$, increasing on $(0,\frac{\pi}{2}), \, (\frac{3\pi}{2},\frac{5\pi}{2})$, and $(\frac{7\pi}{2},12)$

30. [T] The amount of rainfall per month in Phoenix, Arizona, can be approximated by $y(t)=0.5+0.3 \cos t$, where $t$ is the number of months since January. Find $y^{\prime}$ and use a calculator to determine the intervals where the amount of rain falling is decreasing.

For the following exercises, use the quotient rule to derive the given equations.

31.  $\frac{d}{dx}(\cot x)=-\csc^2 x$

32.  $\frac{d}{dx}(\sec x)= \sec x \tan x$

33.  $\frac{d}{dx}(\csc x)=-\csc x \cot x$

34.  Use the definition of derivative and the identity

$\cos (x+h)= \cos x \cos h- \sin x \sin h$ to prove that $\frac{d}{dx}(\cos x)=-\sin x$.

For the following exercises, find the requested higher-order derivative for the given functions.

35.  $\frac{d^3 y}{dx^3}$ of $y=3 \cos x$

$\frac{d^3 y}{dx^3} = 3 \sin x$

36.  $\frac{d^2 y}{dx^2}$ of $y=3 \sin x+x^2 \cos x$

37.  $\frac{d^4 y}{dx^4}$ of $y=5 \cos x$

#### Solution

$\frac{d^4 y}{dx^4} = 5 \cos x$

38.  $\frac{d^2 y}{dx^2}$ of $y= \sec x+ \cot x$

39.  $\frac{d^3 y}{dx^3}$ of $y=x^{10}- \sec x$

#### Solution

$\frac{d^3 y}{dx^3} = 720x^7-5 \tan (x) \sec^3 (x)- \tan^3 (x) \sec (x)$

40. $f^{(24)}(x)$ of $f(x)=8x^{15}- \sin x + e^x$. Notation: $f^{(24)}(x)$ is the 24th derivative of $f$.

41. $f^{(33)}(x)$ of $f(x)=3x^{11} + \cos x + e^x + \pi^3$

#### Solution

$f^{(33)}(x)=-\cos x + e^x$

For the following exercises, determine the limits. Use the fact that $\underset{h\to 0}{\lim}\frac{\sin h}{h}=1$, $\underset{h\to 0}{\lim}\frac{\cos h-1}{h}=0$ and $\tan x =\frac{\sin x}{\cos x}$.

42. $\underset{x\to 0}{\lim} \frac{\cos(2x)-1}{x}$

43. $\underset{x\to 0}{\lim} \frac{\tan(6x)}{\sin(5x)}$

#### Solution

$\frac{6}{5}$

44. $\underset{x\to 0}{\lim} \frac{\tan(3x)}{\sin(4x)}$

45. $\underset{x\to 0}{\lim} \frac{\cos(3x)-1}{x}$

#### Solution

$0$

46. $\underset{\theta\to 0}{\lim} \frac{\sin (7\theta)}{\sin (9\theta)}$

47. $\underset{x\to 0}{\lim} \frac{\sin (\cos x)}{\sec x}$

#### Solution

$\sin (1)$