Matheno - Learn Well and Excel

A.3 Derivatives of sin x and cos x

On this screen we’re going to develop formally the derivatives of $\sin x$ and $\cos x,$ which we will need again and again. We’ll use Desmos to help make sense of the results, and of course also practice using them in various Practice Problems below.

In case you’d simply like to memorize these results so you can move on:

Derivatives of sin x and cos x
\[\dfrac{d}{dx}\sin x = \cos x \quad \text{and} \quad \dfrac{d}{dx}\cos x = -\sin x\]

Yep: the derivative of sin is cosine, and the derivative of cosine is negative sine.
You just gotta remember those.

Tip iconMany students find it helpful to remember that, as it turns out, the trig functions that start with “co,” like “cosine,” have a negative sign in their derivatives, while the trig functions without “co” at their start do not. Hence we can quickly remember that the derivative of cosine is negative sine, while the derivative of sine is (positive) cosine.

You can see a full list of the trig function derivatives on our Handy Table of Trig Function Derivatives, quickly accessible from the “Key Formulas” drop-down menu toward the upper right of every screen. We’ll develop the results for sin and cos below, and for the other trig functions later in this Chapter once we have more tools.


I. Derivative of $\sin x$: $\dfrac{d}{dx}\sin x = \cos x$

 
To find the derivative of $\sin x,$ we start, as always, with the definition of the derivative applied to the function. Recall the definition of the derivative:
\[\dfrac{d}{dx}f(x) = \lim_{h \to 0}\frac{f(x+h) – f(x)}{h}\]

We have $f(x) = \sin (x)$.
Hence
\[f(x+ h) = \sin(x+h) = \sin x \cos h + \sin h \cos x\] where we used the sine addition formula $\sin(x+y) = \sin x \cos y + \sin y \cos x$. (All such trig formulas are available in our Handy Table of Trig Formulas and Identities, also available from the Key Formulas drop-down menu in the upper right of every screen.)

Making these substitutions in the definition of the derivative for $f(x) = \sin x$ gives us
\begin{align*}
\dfrac{d}{dx}\sin x &= \lim_{h \to 0}\frac{\sin(x+h) – \sin x}{h} \\[8px] &= \lim_{h \to 0}\frac{(\sin x \cos h + \sin h \cos x) – \sin x}{h} \\[8px] &= \lim_{h \to 0}\frac{\sin x \cos h – \sin x + \sin h \cos x }{h} \\[8px] &= \lim_{h \to 0}\frac{\sin x \cos h – \sin x}{h} + \lim_{h \to 0}\frac{\sin h \cos x}{h}\\[8px] &= \lim_{h \to 0}\frac{\sin x \,(\cos h – 1)}{h} + \lim_{h \to 0}\frac{\cos x \sin h}{h} \quad [\sin x \text{ and } \cos x \text{ are unaffected by the limit}] \\[8px] &= \sin x\left[ \lim_{h \to 0}\frac{\cos h -1}{h}\right] + \cos x \left[ \lim_{h \to 0}\frac{\sin h}{h}\right] \quad (*)
\end{align*}
You might recognize the “Special Trig Limits” we learned when we were first exploring limits:
\[\lim_{\theta \to 0}\frac{\cos \theta – 1}{\theta} = 0 \quad \text{and}\quad \lim_{\theta \to 0} \frac{\sin \theta}{\theta} = 1\] The actual reason we introduced those then is because we need them now to complete our proof, continuing from the line marked (*):
\begin{align*}
& \phantom{\lim_{h \to 0}\frac{\sin x \cos h – \sin x}{h} + \lim_{h \to 0}\frac{\sin h \cos x}{h} \quad [\sin x \text{ and } \cos x \text{ are unaffected by the limit}]} \\
\dfrac{d}{dx}\sin x &= \sin x\left[ \lim_{h \to 0}\frac{\cos h -1}{h}\right] + \cos x \left[ \lim_{h \to 0}\frac{\sin h}{h}\right] \quad (*) \\[8px] &= \sin x\cancelto{0}{\left[\lim_{h \to 0}\frac{\cos h -1}{h} \right]} + \cos x \cancelto{1}{\left[\lim_{h \to 0}\frac{\sin h}{h} \right]} \\[8px] &= \cos x
\end{align*}
That is, we have the key result:

\[ \dfrac{d}{dx}\sin x = \cos x\]

The following Exploration let’s you explore this relationship graphically.

EXPLORATION 1: Moveable tangent line for $y = \sin x$

The top graph below shows $y = \sin x.$

The lower graph automatically updates to show the value of the function’s derivative at the same point $x=a$ that’s in the upper graph. That is, for each value of $x=a,$ we automatically plot the point $(a, f'(a))$ on the lower graph.

Verify for yourself:

  • Are the zeros of $f'(x)$ where you expect them to be? (That is, where the tangent line to the graph of $y = \sin x$ is horizontal?)
  • Are the maximum and minimum values of $f'(x)$ where you expect them to be? (Where is the slope of the curve $y = \sin x$ steepest in the positive and negative directions?)

Graph of $f(x) = \sin x$ versus x
$\Downarrow$ We automatically plot the point (, ) in the graph below. $\Downarrow$

Graph of f ‘(x) versus x

We can of course show all of the values of $f'(x)$ at once, as if we traced the values we obtain by changing the value of a point-by-point. To do so, check this box:

We hope that you can see for yourself how the way the slope of the tangent line to the curve $y = \sin x$ leads directly to the derivative $f'(x) = \cos x.$

 


II. Derivative of $\cos x$: $\dfrac{d}{dx}\cos x = -\sin x$

 
The approach to finding the derivative of $\cos x$ is very much the same as that for $\sin x$ above; we’ll just make use of a different trig addition formula.

We start of course with the definition of the derivative applied to $g(x) = \cos x.$
Then
\[g(x+h) = \cos(x+h) = \cos x \cos h – \sin x \sin h\] where we have used the trig addition formula $\cos(x+y) = \cos x \cos y – \sin x \sin y.$

The definition of the derivative for $g(x) = \cos x$ then gives us
\begin{align*}
\dfrac{d}{dx}\cos x &= \lim_{h \to 0}\frac{\cos(x+h) – \cos x}{h} \\[8px] &= \lim_{h \to 0}\frac{(\cos x \cos h – \sin x \sin h) – \cos x}{h} \\[8px] &= \lim_{h \to 0}\frac{\cos x \cos h – \cos x – \sin x \sin h }{h} \\[8px] &= \lim_{h \to 0}\frac{\cos x \cos h – \cos x}{h} – \lim_{h \to 0}\frac{\sin x \sin h}{h} \\[8px] &= \lim_{h \to 0}\frac{\cos x (\cos h – 1)}{h} – \lim_{h \to 0}\frac{\sin x \sin h}{h} \quad [\sin x \text{ and } \cos x \text{ are unaffected by the limit}] \\[8px] &= \cos x\left[ \lim_{h \to 0} \frac{\cos h – 1}{h}\right] – \sin x \left[ \lim_{h \to 0}\frac{\sin h}{h}\right] \quad \text{[Same two “special trig limits” as above]}\\[8px] &= \cos x \cancelto{0}{\left[ \lim_{h \to 0}\frac{\cos h – 1}{h}\right]} – \sin x \cancelto{1}{\left[ \lim_{h \to 0}\frac{\sin h}{h}\right]} \\[8px] &= -\sin x
\end{align*}
That is, we have another key result:

\[ \dfrac{d}{dx}\cos x = -\sin x\]

The following Exploration again let’s you see the graphical relationship between the function $g(x) = \cos x$ and its derivative $g'(x) = -\sin x.$

EXPLORATION 2: Moveable tangent line for $y = \cos x$

The top graph below shows $y = \cos x.$

The lower graph automatically updates to show the value of the function’s derivative at the same point $x=a$ that’s in the upper graph. That is, for each value of $x=a,$ we automatically plot the point $(a, f'(a))$ on the lower graph.

Verify for yourself:

  • Are the zeros of $g'(x)$ where you expect them to be? (That is, where the tangent line to the graph of $y = \cos x$ is horizontal?)
  • Are the maximum and minimum values of $g'(x)$ where you expect them to be? (Where is the slope of the curve $y = \cos x$ steepest in the positive and negative directions?)

Graph of $g(x) = \cos x$ versus x
$\Downarrow$ We automatically plot the point (, ) in the graph below. $\Downarrow$
Graph of g'(x) versus x

We can of course show all of the values of $g'(x)$ at once, as if we traced the values we obtain by changing the value of a point-by-point. To do so, check this box:

We hope that you can see for yourself how the way the slope of the tangent line to the curve $y = \cos x$ leads directly to the derivative $g'(x) = -\sin x.$

Practice Problems

As we said above, we’ll use these two derivatives again and again and again, so you’ll have them memorized soon enough. Let’s do a few quick problems now to start:

Practice Problem #1

If $f(x) = \dfrac{1}{2}x^2 + \sin x,$ then $f'(x) =$

\begin{array}{lllll} \text{(A) }x + \cos x && \text{(B) }x - \cos x && \text{(C) }x + \cos x && \text{(D) }2x - \cos x && \text{(E) none of these} \end{array}

Show/Hide Solution
\begin{align*} f(x) &= \frac{1}{2}x^2 + \sin x \\[8px] f'(x) &= \left(\frac{1}{2}x^2 \right)’ + (\sin x)’ \\[8px] &= \frac{1}{2}\left(x^2 \right)’ + \cos x \\[8px] &= \frac{1}{2}(2x) + \cos x \\[8px] &= x + \cos x \implies \text{ (A)} \quad \cmark \end{align*}
[hide solution]
Practice Problem #2

If $f(x) = \cos x + e^x,$ then $\dfrac{df}{dx} = $

\begin{array}{lll} \text{(A) }\sin x + e^x && \text{(B) }-\sin x + e^{x-1} && \text{(C) }-\sin x + xe^{x-1} \end{array}

\begin{array}{ll} \text{(D) }-\sin x + e^x && \text{(E) none of these} \end{array}

Show/Hide Solution
\begin{align*} f(x) &= \cos x + e^x \\[8px] \dfrac{df}{dx} &= \dfrac{d}{dx}\cos x + \dfrac{d}{dx}e^x \\[8px] &= -\sin x + e^x \implies \text{ (D)} \quad \cmark \end{align*}
[hide solution]
Practice Problem #3

The slope of the tangent line to the curve $y = \cos x$ at $x = \dfrac{\pi}{4}$ is

\begin{array}{lllll} \text{(A) }\dfrac{\sqrt{2}}{2} && \text{(B) }-\dfrac{\sqrt{2}}{2} && \text{(C) }-0.014 && \text{(D) }0.014 && \text{(E) none of these} \end{array}

Show/Hide Solution
Since the slope of the tangent line equals the function’s derivative $\dfrac{dy}{dx}$ at the point of interest, $x = \dfrac{\pi}{4},$ there are two steps to this problem:
1. Find the derivative of the function, $\dfrac{dy}{dx}$, and then,
2. Find the value of $\dfrac{dy}{dx}$ at the point, $x = \dfrac{\pi}{4}$.
Step 1: Find the derivative of the function, $\dfrac{dy}{dx}.$ \begin{align*} y &= \cos x \\[8px] \dfrac{dy}{dx} &= -\sin x \\[8px] \end{align*} Step 2: Find the value of $\dfrac{dy}{dx}$ at $x = \dfrac{\pi}{4}$: \begin{align*} \left. \dfrac{dy}{dx} \right|_{x = \pi/4} &= -\sin \left(\frac{\pi}{4} \right) \\[8px] &= -\frac{\sqrt{2}}{2} \implies \text{ (B)} \quad \cmark \end{align*}
[hide solution]
Practice Problem #4

An equation for the tangent line to the curve $f(x) = \cos x$ at $x = \dfrac{\pi}{4}$ is

\begin{array}{lll} \text{(A) }y - \dfrac{\sqrt{2}}{2} = \dfrac{\sqrt{2}}{2}\left(x - \dfrac{\pi}{4} \right) && \text{(B) }y - \dfrac{\sqrt{2}}{2} = -\dfrac{\sqrt{2}}{2}\left(x - \dfrac{\pi}{4} \right) && \text{(C) }y + \dfrac{\sqrt{2}}{2} = -\dfrac{\sqrt{2}}{2}\left(x - \dfrac{\pi}{4} \right) \end{array} \begin{array}{ll}\text{(D) }y - \dfrac{\sqrt{2}}{2} = \dfrac{\sqrt{2}}{2}\left(x - \dfrac{\pi}{4} \right) && \text{(E) none of these} \end{array}

Show/Hide Solution
There are two steps to solving this problem:
1. Find the slope of the tangent line $m_{ \text{tangent} } = f'(x)$ at the point of interest, $x_0=\dfrac{ \pi }{4}$.
2. Find the y-value the at the point of interest $y_{0} = f\left(\dfrac{ \pi }{4} \right)$. Then write down the equation in Point Slope form $y-y_{0} = m_{ \text{tangent}}(x-x_{0})$.
Step 1: Find the slope of the function $m_{ \text{tangent} } = f'(x)$ at the point $x_0=\dfrac{ \pi }{4}$.
We found this value in the preceding problem. For completeness, here’s that calculation again: \begin{align*} f(x) &= \cos x \\[8px] f'(x) &= -\sin x \\[8px] f’\left(\frac{\pi}{4} \right) &= -\sin \left(\frac{\pi}{4} \right) \\[8px] &= -\frac{\sqrt{2}}{2} \end{align*} Step 2: Find the y-value of the point of interest, $y_{0} = f\left( \dfrac{ \pi }{4} \right) = \cos\left( \dfrac{ \pi }{4} \right)$: \[y_{0} = \cos\left(\dfrac{ \pi }{4} \right) = \dfrac{\sqrt{2}}{2} \] Hence we know that the tangent line has slope $m_{ \text{tangent} } = f'(\pi/4) = -\dfrac{\sqrt{2}}{2}$ and passes through the point $\left(x_0, y_0 \right) = \left(\dfrac{\pi}{4}, \dfrac{\sqrt{2}}{2} \right).$ Its equation in point-slope form is then \begin{align*} y-y_{0} &= m_{ \text{tangent}}(x-x_{0}) \\[8px] y – \dfrac{\sqrt{2}}{2} &= -\dfrac{\sqrt{2}}{2}\left(x – \dfrac{\pi}{4} \right) \implies \text{ (B)} \quad \cmark \end{align*}
Graph shows the function f(x) = cos x, and the tangent line at x =  pi over 4.  The point (pi over 4, square root of 2 over 2) is labeled, and text next to the line says tangent line slope equals negative square root of 2 over 2, which is the derivative of cos x at pi over 4.

[hide solution]

These two derivatives complete our initial toolkit of derivatives: You can now find the derivative of power functions, polynomials, exponential, and the two fundamental trig functions. In the next section we’ll see how to take the derivative of a function that is the product or quotient of two other functions, things like $xe^x$ and $\dfrac{\sin x}{\cos x}.$

The Upshot

  1. The derivative of $\sin x$ is $\dfrac{d}{dx}\sin x = \cos x.$
  2. The derivative of $\cos x$ is $\dfrac{d}{dx}\cos x = -\sin x.$


Questions or comments about what’s on this screen, or anything else other Calculus-related? Please post on the Forum!

Buy us a coffee We're working to add more,
and would appreciate your help
to keep going! 😊

We'd appreciate your feedback! 😊
How helpful?

What are your thoughts or questions?

Subscribe
I'd like to be
0 Comments
newest
oldest most voted
Inline Feedbacks
View all comments