# Calculus: Derivatives III

## Second Derivatives

By now we have built up the ability to take the derivative of any function. This third section on derivatives focuses on applications of derivatives to find interesting properties of functions. The first concept to cover is perhaps a bit meta, but nonetheless very important: the second derivative. What is it? It is the derivative of the derivative. And in case you're wondering, the third derivative is the derivative of the derivative of the derivative. It's turtles all the way down!

More concretely, the second derivative is the rate of change of the rate of change. Physics provides the best example: If $f(t)$ is the displacement (i.e. location) of an object over time, then its derivative $f'(t)$ is the velocity of the object over time - the rate at which the object's location is changing. The second derivative, $f''(t)$, is the acceleration of the object over time. Many a sports car enthusiast is concerned with the acceleration of a car, commonly given in the time it takes to reach 60mph.

There is nothing special mathematically about second derivatives aside from a bit of notation. Since we write $\dfrac{d}{dx}y$ more compactly as $\dfrac{dy}{dx}$, we write $\dfrac{d}{dx}\dfrac{d}{dx}y$ as $\dfrac{d^2y}{dx^2}$.

## Problems

1. Find the second derivative of the following function: $y = x^{100}$

Step 1: Calculate the first second derivative

$\dfrac{d}{dx}y = \dfrac{d}{dx} x^{100} \\ \dfrac{dy}{dx} = 100x^{99} \\$

Step 2: Calculate the second derivative

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}100x^{99} \\ \dfrac{d^2y}{dx^2} = 9900x^{98} \\$

2. Find the second derivative of the following function: $y = \sin(\theta)$

Step 1: Calculate the first derivative

$\dfrac{d}{dx}y = \dfrac{d}{dx} \sin(\theta) \\ \dfrac{dy}{dx} = \cos(\theta) \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}\cos(\theta) \\ \dfrac{d^2y}{dx^2} = -\sin(\theta) \\$

3. Find the second derivative of the following function: $y = -\sin(\theta)$

Step 1: Calculate the first derivative

$\dfrac{d}{dx}y = \dfrac{d}{dx} -\sin(\theta) \\ \dfrac{dy}{dx} = -\cos(\theta) \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}-\cos(\theta) \\ \dfrac{d^2y}{dx^2} = \sin(\theta) \\$

4. Find the second derivative of the following function: $y = x$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} x \\ \dfrac{dy}{dx} = 1$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}1 \\ \dfrac{d^2y}{dx^2} = 0 \\$
5. Find the second derivative of the following function: $y = 15$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} 15 \\ \dfrac{dy}{dx} = 0$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}0 \\ \dfrac{d^2y}{dx^2} = 0 \\$
6. Find the second derivative of the following function: $y = \dfrac{x+1}{x-2}$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} \dfrac{x+1}{x-2} \\$

Use the quotient rule:

$\dfrac{dy}{dx} = \dfrac{(x-2)\left(\frac{d}{dx}(x+1)\right) - (x+1)\left(\frac{d}{dx}(x-2)\right)}{(x-2)^2} \\ \dfrac{dy}{dx} = \dfrac{(x-2)(1) - (x+1)(1)}{(x-2)^2} \\ \dfrac{dy}{dx} = \dfrac{x-2 - x - 1}{(x-2)^2} \\ \dfrac{dy}{dx} = \dfrac{-3}{(x-2)^2} \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}\dfrac{-3}{(x-2)^2} \\$

Use the chain rule (it's faster here than the quotient rule):

$\dfrac{d^2y}{dx^2} = \dfrac{d}{dx}-3(x-2)^{-2} \\ \dfrac{d^2y}{dx^2} = 6(x-2)^{-3}\left(\dfrac{d}{dx}(x-2)\right) \\ \dfrac{d^2y}{dx^2} = 6(x-2)^{-3}(1) \\ \dfrac{d^2y}{dx^2} = \dfrac{6}{(x-2)^{-3}} \\$
7. Find the second derivative of the following function: $y = \sin(2x)$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} \sin(2x) \\$

Use the chain rule:

$\dfrac{dy}{dx} = \cos(2x) \dfrac{d}{dx}(2x)\\ \dfrac{dy}{dx} = 2\cos(2x) \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}2\cos(2x) \\$

Use the chain rule:

$\dfrac{d^2y}{dx^2} = -2\sin(2x)\dfrac{d}{dx}2x \\ \dfrac{d^2y}{dx^2} = -4\sin(2x) \\$

8. Find the second derivative of the following function: $y = \ln(\ln(x))$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} \ln(\ln(x)) \\$

Use the chain rule:

$\dfrac{dy}{dx} = \dfrac{1}{\ln(x)} \dfrac{d}{dx}\ln(x)\\ \dfrac{dy}{dx} = \dfrac{1}{\ln(x)}\cdot\dfrac{1}{x} \\ \dfrac{dy}{dx} = \dfrac{1}{x\ln(x)} \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}\dfrac{1}{x\ln(x)} \\$

Use the chain rule:

$\dfrac{d^2y}{dx^2} = \dfrac{d}{dx}\left(x\ln(x)\right)^{-1} \\ \dfrac{d^2y}{dx^2} = (-1)\left(x\ln(x)\right)^{-2} \cdot \left(\dfrac{d}{dx}x\ln(x)\right) \\$

Use the product rule:

$\dfrac{d^2y}{dx^2} = -\left(x\ln(x)\right)^{-2} \cdot \left(\left(\dfrac{d}{dx}x\right)\ln(x) + x\left(\dfrac{d}{dx}\ln(x)\right)\right) \\ \dfrac{d^2y}{dx^2} = -\left(x\ln(x)\right)^{-2} \cdot \left((1)\ln(x) + x\left(\dfrac{1}{x}\right)\right) \\ \dfrac{d^2y}{dx^2} = -\left(x\ln(x)\right)^{-2} \cdot \left(\ln(x) + 1\right) \\ \dfrac{d^2y}{dx^2} = - \dfrac{\ln(x) + 1}{x^2\ln^2(x)} \\$
9. Find the second derivative of the following function: $y = \ln(e+x^4-ex^2)$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} \ln(e+x^4-ex^2) \\$

Use the chain rule:

$\dfrac{dy}{dx} = \dfrac{1}{e+x^4-ex^2} \dfrac{d}{dx}(e+x^4-ex^2) \\ \dfrac{dy}{dx} = \dfrac{1}{e+x^4-ex^2} (4x^3-2ex) \\ \dfrac{dy}{dx} = \dfrac{4x^3-2ex}{e+x^4-ex^2} \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{4x^3-2ex}{e+x^4-ex^2} \\$

Use the quotient rule:

$\dfrac{d^2y}{dx^2} = \dfrac{\left(e+x^4-ex^2\right)\left(\frac{d}{dx}\left(4x^3-2ex\right)\right) - \left(4x^3-2ex\right)\left(\frac{d}{dx}\left(e+x^4-ex^2\right)\right)}{(e+x^4-ex^2)^2} \\ \dfrac{d^2y}{dx^2} = \dfrac{\left(e+x^4-ex^2\right)\left(12x^2-2\right) - \left(4x^3-2ex\right)\left(4x^3-2ex\right)}{(e+x^4-ex^2)^2} \\ \dfrac{d^2y}{dx^2} = \dfrac{12x^6-12ex^4-2x^4+14ex^2-2e - 16x^6 + 16ex^4 - 4e^2x^2}{x^4 - 2ex^6 + e^2x^4 + 2ex^4 -2e^2x^2 + e^2} \\ \dfrac{d^2y}{dx^2} = \dfrac{-4x^6+4ex^4-2x^4-4e^2x^2 + 14ex^2 - 2e}{x^4 - 2ex^6 + e^2x^4 + 2ex^4 -2e^2x^2 + e^2} \\$
10. Find the fourth derivative of the following function: $y = \cos(\theta) + \sin(\theta)$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx}\left( \cos(\theta) + \sin(\theta) \right) \\ \dfrac{dy}{dx} = \dfrac{d}{dx}\cos(\theta) + \dfrac{d}{dx}\sin(\theta) \\ \dfrac{dy}{dx} = -\sin(\theta) + \cos(\theta) \\$

Step 2: Calculate the second derivative:

$\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}\left( -\sin(\theta) + \cos(\theta) \right) \\ \dfrac{d^2y}{dx} = -\cos(\theta) - \sin(\theta) \\$

Step 3: Calculate the third derivative:

$\dfrac{d}{dx}\dfrac{d^2y}{dx^2} = \dfrac{d}{dx}\left( -\cos(\theta) - \sin(\theta) \right) \\ \dfrac{d^3y}{dx^3} = \sin(\theta) - \cos(\theta) \\$

Step 4: Calculate the fourth derivative:

$\dfrac{d}{dx}\dfrac{d^3y}{dx^3} = \dfrac{d}{dx}\left( \sin(\theta) - \cos(\theta) \right) \\ \dfrac{d^4y}{dx^4} = \cos(\theta) + \sin(\theta) \\$
11. Find the second derivative of the following function: $y = e^{x^2}$

Step 1: Calculate the first derivative:

$\dfrac{d}{dx}y = \dfrac{d}{dx} e^{x^2} \\$

Use the chain rule:

$\dfrac{dy}{dx} = e^{x^2}\cdot\left(\dfrac{d}{dx} x^2 \right) \\ \dfrac{dy}{dx} = e^{x^2}\cdot\left(2x \right) \\ \dfrac{dy}{dx} = 2xe^{x^2} \\$

Step 2: Calculate the second derivative: $\dfrac{d}{dx}\dfrac{dy}{dx} = \dfrac{d}{dx}2xe^{x^2} \\$

Use the product rule:

$\dfrac{d^2y}{dx^2} = \left(\dfrac{d}{dx}2x\right)e^{x^2} + 2x\left(\dfrac{d}{dx}e^{x^2}\right) \\$

Notice that $\dfrac{d}{dx}e^{x^2}$ was already computed in Step 1.

$\dfrac{d^2y}{dx^2} = \left(2\right)e^{x^2} + 2x\left(2xe^{x^2}\right) \\ \dfrac{d^2y}{dx^2} = 2e^{x^2} + 4x^2e^{x^2} \\$