 # The Trigonometric Functions by Stefan Waner and Steven R. Costenoble ## This Section: 3. Derivatives of Trigonometric Functions 3. Derivatives of Trigonometric Functions

We shall start by giving the derivative of $f(x) = \sin x,$ and then using it to obtain the derivatives of the other five trigonometric functions.

 Derivative of $\sin x$ The derivative of the sine function is given by $\frac{d}{dx} \sin x = \cos x.$

That's all there is to it!

Question
Where did that come from?

We shall justify this at the end of this section. (If you can't wait, press the pearl to go there now.) Example 1

Calculate $dy/dx$ if:
(a) $y = x \sin x$ (b) $y = \cosec x$ (c) $y = \frac{x^2+x}{\sin x}$
(d) $y = \sin(3x^2-1)$

Solution

(a) An application of the calculator thought experiment (CTE)* tells us that $x \sin x$ is a product;

$y = (x)(\sin x).$

Therefore, by the product rule,

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

(b) Recall from Section 2 that

$y = \cosec x = \frac{1}{\sin x}.$

Therefore, by the quotient rule,

$\frac{dy}{dx} = \frac{(0)(\sin x) - (1)(\cos x)}{\sin^2x}$     (recall that $\sin^{2}x$ is just $(\sin x)^{2})$
$= \frac{-\cos x}{\sin^2x}$
$= - \frac{\cos x}{\sin x} . \frac{1}{\sin x}$
$= - \cotan x \cosec x.$     (from the identities in Section $2$)

Notice that we have just obtained the derivative of one of the remaining five trigonometric functions. Four to go...

(c) Since the given function is a quotient,

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

and let us just leave it like that (there is no easy simplification of the answer).

(d) Here, an application of the CTE tells us that y is the sine of a quantity.

Since

$\frac{d}{dx} \sin x = \cos x,$

the chain rule ( press the pearl to go to the topic summary for a quick review) tells us that

$\frac{d}{dx} \sin \color{blue}{u} = \cos \color{blue}{u} \frac{d\color{blue}{u}}{dx}$

so that

$\frac{d}{dx} \sin \color{blue}{(3x^2-1)} = \cos \color{blue}{(3x^2-1)} \frac{d}{dx} \color{blue}{(3x^2-1)}$

$= 6x \cos(3x^2-1)$    (we placed the $6x$ in front to avoid confusion—see below)

* See Example 6 on p. 258 in Calculus Applied to the Real World, or p. 756 in Finite Mathematics and Calculus Applied to the Real World. Alternatively, press here to consult the on-line topic summary, where the CTE is also discussed.

Before we go on...

Try to avoid writing expressions such as $\cos(3x^2-1)(6x).$ Does this mean

$\cos[(3x^2-1)(6x)]$   (the cosine of the quantity $(3x^2-1)(6x)$),

or does it mean

$[\cos(3x^2-1)](6x)$(the product of $\cos(3x^2-1)$ and $6x$)?

That is why we placed the $6x$ in front of the cosine expression.

Question
What about the derivative of the cosine function?

Let us use the identity

$\cos x = \sin(\pi/2-x)$

from Section 1, and follow the method of Example 1(d) above: if

$y = \cos x = \sin(\pi/2-x),$

then, using the chain rule,

$\frac{dy}{dx} = \cos(\pi/2-x) \frac{d}{dx}(\pi/2-x)$

$= (-1)\cos(\pi/2-x)$               (since $\pi/2$ is constant, and $d/dx(-x) = -1$)

$= -\sin x$                                (using the identity $\cos(\pi/2-x) = \sin x$)

Question
And the remaining three trigonometric functions?

Since all the remaining ones are expressible in terms of $\sin x$ and $\cos x,$ we shall leave them for you to do in the exercises!

 Original Rule Generalized Rule (Chain Rule) $\frac{d}{dx} \sin x = \cos x$ $\frac{d}{dx} \sin \color{blue}{u} = \cos \color{blue}{u}\frac{d\color{blue}{u}}{dx}$ $\frac{d}{dx} \cos x = -\sin x$ $\frac{d}{dx} \cos \color{blue}{u} = -\sin \color{blue}{u} \frac{d\color{blue}{u}}{dx}$ $\frac{d}{dx} \tan x = \sec^2 x$ $\frac{d}{dx} \tan \color{blue}{u} = \sec^2\color{blue}{u} \frac{d\color{blue}{u}}{dx}$ $\frac{d}{dx} \cotan x = -\cosec^2 x$ $\frac{d}{dx} \cotan \color{blue}{u} = -\cosec^2\color{blue}{u} \frac{d\color{blue}{u}}{dx}$ $\frac{d}{dx} \sec x = \sec x \tan x$ $\frac{d}{dx} \sec \color{blue}{u} = \sec \color{blue}{u}\ \tan \color{blue}{u} \frac{d\color{blue}{u}}{dx}$ $\frac{d}{dx} \cosec x = -\cosec x \cotan x$ $\frac{d}{dx} \cosec \color{blue}{u} = -\cosec \color{blue}{u}\ \cotan \color{blue}{u} \frac{d\color{blue}{u}}{dx}$ Example 2

Find the derivatives of the following functions.

 (a) $f(x) = \tan(x^2-1)$ (b) $g(x) = \cosec(e^{3x})$ (c) $h(x) = e^{-x}\sin(2x)$ (d) $r(x) = \sin^2x$ (e) $s(x) = \sin(x^2)$

Solution

(a) Since $f(x)$ is the $\tan$ of a quantity, we use the chain rule form of the derivative of tangent:

 $\frac{d}{dx} \tan \color{blue}{u} = \sec^2\color{blue}{u} \frac{d\color{blue}{u}}{dx}$
 $\frac{d}{dx} \tan(x^2-1) = \sec^2(x^2-1) \frac{d(x^2-1)}{dx}$ (substituting $u = x^2-1)$ $\ \ \ \ \ \ \ \ \ = 2x\ \sec^2(x^2-1).$

(b) Since $g(x)$ is the cosecant of a quantity, we use the rule

 $\frac{d}{dx} \cosec \color{blue}{u} = -\cosec \color{blue}{u}\ \cotan \color{blue}{u} \frac{d\color{blue}{u}}{dx}$
 $\frac{d}{dx}$ $\cosec(e^{3x})$ $= -\cosec(e^{3x}) \cotan(e^{3x}) \frac{d(e^{3x})}{dx}$ $= -3e^{3x} \cosec(e^{3x}) \cotan(e^{3x}).$ (the derivative of $e^{3x}$ is $3e^{3x})$

(c) Since $h(x)$ is the product of $e^{-x}$ and $\sin(2x),$ we use the product rule,

 $h'(x) = (-e^{-x})\sin(2x) + e^{-x} \frac{d}{dx} [\sin(2x)]$ $\ \ \ \ \ \ \ \ \ = (-e^{-x}) \sin(2x) + e^{-x} \cos(2x) \frac{d}{dx} [2x]$ (using $d/dx \sin u = \cos u\ du/dx)$ $\ \ \ \ \ \ \ \ \ = -e^{-x}\sin(2x) + 2e^{-x}\cos(2x).$

(d) Recall that $\sin^2x = (\sin x)^2.$ Thus, $r(x)$ is the square of a quantity (namely, the quantity $\sin x$). Therefore, we use the chain rule for differentiating the square of a quantity,

 $\frac{d}{dx} [\color{blue}{u^2}] = 2\color{blue}{u} \frac{d\color{blue}{u}}{dx}$
 $\frac{d}{dx}$ $[(\sin x)^2]$ $=$ $2(\sin x)$ $\frac{d(\sin x)}{dx}$ $=$ $2 \sin x \cos x.$

(e) Notice the difference between $\sin^2x$ and $\sin(x^2)$. The first is the square of $\sin x,$ while the second is the $\sin$ of the quantity $x^2.$ Since we are differentiating the latter, we use the chain rule for differentiating the sine of a quantity:

 $\frac{d}{dx} \sin \color{blue}{u} = \cos \color{blue}{u} \frac{d\color{blue}{u}}{dx}$
 $\frac{d}{dx}$ $\sin(x^2)$ $=$ $\cos(x^2)$ $\frac{d(x^2)}{dx}$ $=$ $2x \cos(x^2).$

Question
There is still some unfinished business...

Indeed. We will now motivate the formula that started it all:

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

We shall do this calculation from scratch, using the general formula for a derivative:

$\frac{d}{d} f(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$

since here, $f(x) = \sin x,$ we can write

$\frac{d}{d} \sin(x) = \lim_{h \to 0} \frac{\sin(x+h) - \sin(x)}{h}$ . . . . (I)

We now use the addition formula in the preceding exercise set to expand $\sin(x+h):$

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

Substituting this in formula (I) gives

$\frac{d}{d} \sin(x) = \lim_{h \to 0} \frac{\sin x \cos h + \cos x \sin h - \sin(x)}{h}.$

Grouping the first and third terms together, and factoring out the $\sin x$ gives

 $\frac{d}{d}$ $\sin(x) = \lim_{h \to 0} \frac{\sin x (\cos h - 1) + \cos x \sin h}{h}$ $= \lim_{h \to 0} \frac{\sin x (\cos h - 1)}{h} + \lim_{h \to 0} \frac{\cos x \sin h}{h}$ $= \sin x\ \lim_{h \to 0} \frac{(\cos h - 1)}{h} + \cos x\ \lim_{h \to 0} \frac{\sin h}{h}$

and we are left with two limits to evaluate. Calculating these limits analytically requires a little trigonometry (press here for these calculations). Alternatively, we can get a good idea of what these two limits are by estimating them numerically. We find that:

$\lim_{h \to 0} \frac{(\cos h - 1)}{h} = 0$

and

$\lim_{h \to 0} \frac{\sin h}{h} = 1$

Therefore,

$\frac{d}{dx} \sin x = \sin x (0) + \cos x (1) = \cos x.$  We would welcome comments and suggestions for improving this resource.

Mail us at: Stefan Waner (matszw@hofstra.edu) Steven R. Costenoble (matsrc@hofstra.edu)

Last Updated: March, 1997
Copyright © 1997 StefanWaner and Steven R. Costenoble