curve2 <- function(fx, d1, d2, xlim, ylim) {
    if (missing(xlim)) {
        xlim = c(-5, 5)
    }
    if (missing(ylim)) {
        ylim = c(-2, 8)
    }
    plot(c(), c(), type = "n", xlim = xlim, ylim = ylim, xlab = "x", ylab = "y")
    abline(h = 0, v = 0, col = "gray", lty = 3, xlim = xlim, ylim = ylim, xlab = "", 
        ylab = "")
    par(new = T)
    curve(fx, lwd = 2, col = "black", xlim = xlim, ylim = ylim, xlab = "", ylab = "")
    if (!missing(d1)) {
        par(new = T)
        curve(d1, lwd = 2, col = "red", xlim = xlim, ylim = ylim, xlab = "", 
            ylab = "")
    }
    if (!missing(d2)) {
        par(new = T)
        curve(d2, lwd = 2, col = "green", xlim = xlim, ylim = ylim, xlab = "", 
            ylab = "")

    }
    # mtext('Test text', 3)
}
# curve2(function(x){return
# (x^2)},function(x){return(2*x)},function(x){return(2*(x/x))})

3. Basics of Derivatives

3.1 Slopes of Tangent Lines via Limits

1. If the line \( y = 7x - 4 \) is tangent to \( f(x) \) at \( x=2 \), find $f(2) and \( f'(2) \).

\( f(2) \) must be \( 7(2) - 4 = 10 \). The slope of \( f(x) \) at \( x=2 \) is 7, so that is the value of \( f'(2) \). \( f(2) = 7(2) - 4 = 10 \).

2. Here are plots of four functions. Two of these functions are the derivatives of the other two. Identify which functions are the derivatives of the others.

\( q(x)=r'(x) \), \( s(x) = p'(x) \)

3. If \( f(3) = 6 \) and \( f(3.1) = 6.4 \), estimate \( f'(3) \).

The slope between \( f(3) \) and \( f(3.1) \) is \( (6.4-6)/(3.1-3) = 4 \). So an estimate of \( f'(3) = 4 \).

4. If \( f(-2)=4 \) and \( f(-2+h)=(h+2)^2 \), compute \( f'(-2) \).

Not sure if this is the actual solution. If \( f(-2+h)=(h+2)^2 \), then \( f'(-2+h)=2(h+2) = 2h + 4 \). If we assume that \( h = 0 \), then \( f'(-2+0) = 2(0) + 4 = 4 \).

5. If \( f'(x) = x^3 \) and \( f(1)=2 \), approximate \( f(1.2) \).

The slope of \( f(1)=1 \). Since \( f(1)=2 \), the result is \( x \) times the slope plus 1. We use that as the estimate for \( f(1.2) \), so the estimate for \( f(1.2) \) is \( 1.2*1 + 1 = 2.2 \).

3.2 Basic Derivative Rules

1. \( \frac{d}{dx} 5 = 0 \)

2. \( \frac{d}{dx} -7 = 0 \)

3. \( \frac{d}{dx} e^7 = 0 \)

4. \( \frac{d}{dx} \frac{1}{sqrt{2}} = 0 \)

5. \( \frac{d}{dx} x^{100} = 100x^{99} \)

6. \( \frac{d}{dx} x^{-100} = -100x^{-101} \)

7. \( \frac{d}{dx} \frac{1}{x^5} = -\frac{5}{x^6} \)

8. \( \frac{d}{dx} x^{\pi} = \pi x^{\pi - 1} \)

9. \( \frac{d}{dx} x^{3/4} = \frac{3}{4x^{1/4}} \)

10. \( \frac{d}{dx} \frac{1}{(\sqrt[7]{x})^9} = \frac{d}{dx} x^{-9/7} = -\frac{9}{7x^{16/7}} \)

11. \( \frac{d}{dx} (5x^3 + 12x^2 - 15) = 15x^2 + 24x \)

12. \( \frac{d}{dx} (-4x^5 +3x^2 - \frac{5}{x^2}) = -20x^4 + 6x + \frac{10}{x^3} \)

13. \( \frac{d}{dx} 5(-3x^2 + 5x + 1) = -15x + 25 \)

14. \( \frac{d}{dx} (3\sqrt{x} + \frac{1}{x} - x^e) = \frac{3}{2\sqrt{x}} - \frac{1}{x^2} - ex^{e-1} \)

15. \( \frac{d}{dx} (\frac{x^2}{x^7} + \frac{\sqrt{x}}{x}) = \frac{d}{dx} x^{-5} + x^{-1/2} = -5x^{-6} -\frac{1}{2x^{3/2}} \)

16. \( \frac{d}{dx} e^x = e^x \)

17. \( \frac{d}{dx} x^e = ex^{e-1} \)

18. \( \frac{d}{dx} 3e^x = 3e^x \)

19. \( \frac{d}{dx} (3x^4 - 7x^2 + 12e^x) = 12x^3 -14x + 12e^x \)

20. \( \frac{d}{dx}((x+1)(x^2+2x-3)) = \frac{d}{dx} x^3 + 2x^2 -3x + x^2 + 2x - 3 = \frac{d}{dx} x^3 + 3x^2 -x -3 = 3x^2 + 6x -1 \)

21. \( \frac{d}{dx} \frac{x^3 - 2x^2 -5x + 6}{(x-1)} = \frac{d}{dx} \frac{(x^2 - x - 6)(x-1)}{x-1} = \frac{d}{dx} x^2 - x - 6 = 2x -1 \)

22. \( \frac{d}{dx} \frac{x-5}{\sqrt{x} - \sqrt{5}} = \frac{d}{dx} \frac{(\sqrt{x} + \sqrt{5})(\sqrt{x} - \sqrt{5}} {\sqrt{x} - \sqrt{5}} = \frac{d}{dx} \sqrt{x} + \sqrt{5} = \frac{1}{2\sqrt{x}} \)

23. \( \frac{d}{dx} ((x + 1)(x + 1)(x-1)(x-1)) = \frac{d}{dx} (x^2-1)(x^2-1) = \frac{d}{dx} x^4 - 2x^2 + 1 = 4x^3 - 4x \)

24. Suppose the position of an object at time \( t \) is given by \( f(t) = -49t^2/10 +5t + 10 \). Find a function givin the velocity of the object at the time \( t \). The acceleration of an object is that rate at which its velocity is changing, which means it is given by the derivativew of the velocity function. Find the acceleration of the object at time \( t \).

Velocity:

\( f'(t) = -49t/5 + 5 \)

Acceleration: \( f''(t) = -49/5 \)

25. Let \( f(x) = x^3 \) and \( c=3 \). Sketch the graphs of \( f(x), cf(x), f'(x) \), and \( cf'(x) \) on the same diagram.

xlim = c(-2, 2)
ylim = c(-5, 5)
f <- function(x) {
    return(x^3)
}
curve(f, xlim = xlim, ylim = ylim, col = "black")
f <- function(x) {
    return(3 * (x^3))
}
par(new = T)
curve(f, xlim = xlim, ylim = ylim, col = "red")
par(new = T)
f <- function(x) {
    return(3 * x^2)
}
curve(f, xlim = xlim, ylim = ylim, col = "blue")
par(new = T)
f <- function(x) {
    return(3 * (3 * x^2))
}
curve(f, xlim = xlim, ylim = ylim, col = "green")

plot of chunk unnamed-chunk-2

26. Find a cubic polynomial whose graph has horizontal tangents at (-2, 5) and (2, 3).

No, I won't. This is an invitation to waste a lot of time.

27. Find an equation for the tangent line to \( f(x) = x^3/4 - 1/x \) at \( x = -2 \).

f <- function(x) {
    return(x^3/4 - (1/x))
}
curve(f, xlim = c(-4, 4), ylim = c(-4, 4))
abline(h = 0, v = 0, col = "gray", lty = 3, xlim = c(-4, 4), ylim = c(-4, 4), 
    xlab = "", ylab = "")
par(new = T)
f <- function(x) {
    return(13 * x/4 + 5)
}
curve(f, xlim = c(-4, 4), ylim = c(-4, 4), col = "red")

plot of chunk unnamed-chunk-3

\( f(-2) = -3/2 \)
\( f'(x) = 3x^2/4 + 1/x^2 \)
\( f'(-2) = 13/4 \)

\( (y-(-3/2) = 13/4(x - (-2)) \)
\( y = 13x/4 + 13/2 - 3/2 \)
\( y = 13x/4 + 5 \)

28. Find an equation for the tangent line to \( f(x) = 3x^2 - \pi^3 \) at \( x=4 \).

xlim = c(-1, 5)
ylim = c(-160, 120)
f <- function(x) {
    return(3 * x^2 - pi^3)
}
curve(f, xlim = xlim, ylim = ylim)
abline(h = 0, v = 0, col = "gray", lty = 3, xlim = xlim, ylim = ylim, xlab = "", 
    ylab = "")
par(new = T)
f <- function(x) {
    return(24 * x - 48 - pi^3)
}
curve(f, xlim = xlim, ylim = ylim, col = "red")

plot of chunk unnamed-chunk-4

\( f(4) = 48 - \pi^3 = 16.99372 \)
\( f'(x) = 6x \)

So the slope at \( (4, 16.99372) \) is \( 6(4) = 24 \)

\( (y-(48 - \pi^3)) = 24(x - 4) \)
\( y = 24x - 96 +48 - \pi^3 \) Or:
\( y = 24x - 48 - \pi^3 \)

29. Prove that \( \frac{d}{dx}(cf(x)) = cf'(x) \) using the definition of the derivative.

\( \frac{d}{dx} cf(x) = \lim_{h \to 0} \frac{cf(x + h) - c(f(x))}{h} = c\lim_{x \to 0} \frac{f(x+h)-f(x)}{h} = cf'(x) \)

4. Curve Sketching

4.1 Extrema

1. \( y = x^2 - x \)

\( f'(x) = 2x - 1 \)

Critical point at \( x = 1/2 \)

\( f(0) = 0 \) \( f(1/2) = -1/2 \) \( f(1) = 0 \)

Since \( f(x) \) is greater on either side of the critical point than the critical point itself, local minimum.

2. 2 + 3x - x3$

\( f'(x) = -3x^2 + 3 \)

Critical points at \( -1, 1 \)

\( f(-2) = 4 \)
\( f(-1) = 0 \)
\( f(0) = 2 \)
\( f(1) = 4 \)
\( f(2) = 0 \)

\( f(-1) \) is a local minimum, \( f(1) \) is a local maximum

3. \( y = x^3 - 9x^2 + 24x \)

\( f'(x) = 3x^2 - 18x + 24 \)

Critical points at \( x=2, x=4 \)

\( f(0) = 0 \)
\( f(2) = 20 \)
\( f(3) = 18 \)
\( f(4) = 16 \)
\( f(5) = 20 \)

\( x=2 \) is a local maximum, \( x=4 \) is a local minimum

4. \( x^4 - 2x^2 + 3 \)

\( f'(x) = 4x^3 - 4x \)

Critical points at \( -1, 0, 1 \)

\( f(-2) = 11 \) \( f(-1) = 2 \)
$f(-0.5) = 2.5625 \( f(0) = 3 \)
\( f(0.5) = 2.5625 \)
\( f(1) = 2 \)
\( f(2) = 11 \)

\( x=-1 \) is a local minimum, \( x=0 \) is a local maximum, \( x=1 \) is a local minimum

5. \( y = 3x^4 - 4x^3 \)

\( f'(x) = 12x^3 - 12x^2 \)

Critical points at \( 0, 1 \)

\( f(-1) = 7 \)
\( f(0) = 0 \)
\( f(0.5) = -0.3125 \)
\( f(1) = -1 \)
\( f(2) = 16 \)

\( x = 0 \) is neither, \( x=1 \) is a local minimum

6. \( y=(x^2-1)/x \)

4.2 The First Derivative Test

In the following exercises, find all critical points and identify them as local maximum points, local minimum points, or neither.

Note that all black curves are \( f(x) \) and all red curves are \( f'(x) \).

1. \( y = x^2 - x \)

curve2(function(x) {
    return(x^2 - x)
}, function(x) {
    return(2 * x - 1)
})

plot of chunk unnamed-chunk-5

\( f(x) = x^2 - x \)
\( f'(x) = 2x - 1 \)

Critical points for \( f'(x) \): \( x = 1/2 \)

\( f'(0) = -1 \)
\( f'(1) = 1 \)

\( x = 1/2 \): Local minimum

2. \( y = 2 + 3x - x^3 \)

curve2(function(x) {
    return(2 + 3 * x - x^3)
}, function(x) {
    return(3 - 3 * x^2)
})

plot of chunk unnamed-chunk-6

\( f(x) = 2 + 3x - x^3 \)
\( f'(x) = 3 - 3x^2 \)

Critical points for \( f'(x) \): \( x = \pm 1 \)

\( f'(-2) = -9 \)
\( f'(0) = 3 \)
\( f'(2) = -9 \)

\( x = -1 \): Local minimum
\( x = 1 \): Local maximum

3. \( y = x^3 - 9x^2 + 24x \)

curve2(function(x) {
    return(x^3 - 9 * x^2 + 24 * x)
}, function(x) {
    return(3 * x^2 - 18 * x + 24)
}, xlim = c(-1, 9), ylim = c(-5, 20))

plot of chunk unnamed-chunk-7

\( f(x) = x^3 - 9x^2 + 24x \)
\( f'(x) = 3x^2 - 18x + 24 \)

Critical points for \( f'(x) \): \( x=2, x=4 \)

\( f'(1) = 9 \)
\( f'(3) = -3 \)
\( f'(5) = 9 \)

\( x = 2 \): Local maximum
\( x = 4 \): Local minimum

4. \( y = x^4 - 2x^2 + 3 \)

curve2(function(x) {
    return(x^4 - 2 * x^2 + 3)
}, function(x) {
    return(4 * x^3 - 4 * x)
}, xlim = c(-5, 5), ylim = c(-5, 20))

plot of chunk unnamed-chunk-8

\( f(x) = x^4 - 2x^2 + 3 \)
\( f'(x) = 4x^3 - 4x \)

Critical points for \( f'(x) \): \( x=0, x=1, x=-1 \)

\( f'(-2) = -24 \)
\( f'(-0.5) = 2.5 \)
\( f'(0.5) = -1.5 \)
\( f'(2) = 24 \)

\( x = -1 \): Local minimum
\( x = 0 \): Local maximum
\( x = 1 \): Local minimum

5. \( y = 3x^4 - 4x^3 \)

curve2(function(x) {
    return(3 * x^4 - 4 * x^3)
}, function(x) {
    return(12 * x^3 - 12 * x^2)
}, xlim = c(-2, 2), ylim = c(-5, 5))

plot of chunk unnamed-chunk-9

\( f(x) = 3x^4 - 4x^3 \)
\( f'(x) = 12x^3 - 12x^2 \)

Critical points for \( f'(x) \): \( x = 0, x = 1 \)

\( f'(-1) = -24 \)
\( f'(0.5) = -3/2 \)
\( f'(2) = 48 \)

\( x = 0 \): neither
\( x = 1 \): local minimum

6. \( y = (x^2-1)/x \)

curve2(function(x) {
    return((x^2 - 1)/x)
}, function(x) {
    return((x^2 + 1)/x^2)
}, xlim = c(-5, 5), ylim = c(-5, 5))

plot of chunk unnamed-chunk-10

\( f(x) = (x^2 -1)/x \)
\( f'(x) = (x^2 + 1)/x^2 \)

Critical points for \( f'(x) \): \( x = 0 \)

\( f'(-1) = 2 \)
\( f(1) = 2 \)

\( x = 0 \): neither

7. \( f(x) = |x^2 - 121| \)

curve2(function(x) {
    return(abs(x^2 - 121))
}, xlim = c(-80, 80), ylim = c(-5, 155))

plot of chunk unnamed-chunk-11

8. Let \( f(x) = ax^2 + bx + c \) with \( a \ne 0 \). Show that \( f(x) \) has exactly one critical point using the first derivative test. Give conditions on \( a \) and \( b \) which guarantee that the critical point will be a maximum.

4.3 Concavity and inflection points

N.B. the title of this section; the focus is on concavity, not extrema. Concavity can be one-sided, i.e., one side of an inflection point has different concavity than the other, or it can be simply one-sided, in the case of an asymptote (see problem 6).

In the following exercises, describe the concavity of the function.

Note that all black curves are \( f(x) \), all red curves are \( f'(x) \) and all green curves are \( f''(x) \).

1. \( y=x^2-x \)

curve2(function(x) {
    return(x^2 - x)
}, function(x) {
    return(2 * x - 1)
}, function(x) {
    return(2 * (x/x))
})

plot of chunk unnamed-chunk-12

\( f(x) = x^2 - x \)
\( f'(x) = 2x - 1 \)
\( f''(x) = 2 \)

Find critical points for f'(x): \( 2x - 1 = 0 \)
\( 2x = 1 \)
\( x = 1/2 \)

Critical points for f'(x): \( 1/2 \)

Critical points for f''(x): None, f''(x) is always greater than zero

Answer: Concave up everywhere

2. \( y = 2 + 3x - x^3 \)

curve2(function(x) {
    return(2 + 3 * x - x^3)
}, function(x) {
    return(3 - 3 * x^2)
}, function(x) {
    return(-6 * x)
})

plot of chunk unnamed-chunk-13

\( f(x) = 2 + 3x - x^3 \)
\( f'(x) = 3 - 3x^2 \)
\( f''(x) = -6x \)

Find critical points for f'(x):

\( 3 - 3x^2 = 0 \)
\( x^2 = 3 \)
\( x = \pm \sqrt{3} \)

Critical points for f'(x): \( \pm \sqrt{3} \)

Find critical points for f''(x):

\( -6x = 0 \)

Critical points for f''(x): \( 0 \)

\( f''(-\sqrt{3}) = 6\sqrt{3} \)
\( f''(\sqrt{3}) = -6\sqrt{3} \)

Answer:

\( x < 0 \): Concave up \( x > 0 \): Concave down

3. \( x^3 - 9x^2 + 24x \)

curve2(function(x) {
    return(x^3 - 9 * x^2 + 24 * x)
}, function(x) {
    return(3 * x^2 - 18 * x + 24)
}, function(x) {
    return(6 * x - 18)
}, xlim = c(-1, 9), ylim = c(-5, 20))

plot of chunk unnamed-chunk-14

\( f(x) = x^3 - 9x^2 + 24x \)
\( f'(x) = 3x^2 - 18x + 24 \)
\( f''(x) = 6x - 18 \)

Find critical points for f'(x): \( 3x^2 - 18x + 24 = 0 \)
\( x^2 - 6x + 8 = 0 \)
\( (x - 4)(x - 2) = 0 \)

Critical points for f'(x): \( 2, 4 \)

Find critical points for f''(x): \( 6x - 18 = 0 \)
\( 6x = 18 \)
\( x = 3 \)

Critical points for f''(x): \( 3 \)

\( f''(2) = -6 \)
\( f''(4) = 6 \)

Answer: \( x < 3 \): Concave down, \( x > 3 \): Concave up

4. \( x^4 - 2x^2 + 3 \)

curve2(function(x) {
    return(x^4 - 2 * x^2 + 3)
}, function(x) {
    return(4 * x^3 - 4 * x)
}, function(x) {
    return(12 * x^2 - 4)
}, xlim = c(-5, 5), ylim = c(-5, 20))

plot of chunk unnamed-chunk-15

\( f(x) = x^4 - 2x^2 + 3 \)
\( f'(x) = 4x^3 - 4x \)
\( f''(x) = 12x^2 - 4 \)

Find critical points for f'(x)

\( 4x^3 - 4x = 0 \)
\( x(4x^2 - 4) = 0 \)
\( x = 0 \), \( x^2 = 1 \), \( x = \pm 1 \)

Critical points for f'(x): \( -1, 0, 1 \)

Find critical points for f''(x)

\( 12x^2 - 4 = 0 \)
\( 3x^2 = 1 \)
\( x^2 = 1/3 \)
\( x = \pm \sqrt{1/3} \)

\( f''(-1) = 8 \)
\( f''(0) = -4 \)
\( f''(1) = 8 \)

Answer: \( x < -\sqrt{1/3} \): Concave up, \( -\sqrt{1/3} < x < \sqrt{1/3} \): Concave down, \( x > \sqrt{1/3} \): Concave up

5. \( 3x^4 - 4x^3 \)

curve2(function(x) {
    return(3 * x^4 - 4 * x^3)
}, function(x) {
    return(12 * x^3 - 12 * x^2)
}, function(x) {
    return(36 * x^2 - 24 * x)
}, xlim = c(-2, 2), ylim = c(-5, 5))

plot of chunk unnamed-chunk-16

\( f(x) = 3x^4 - 4x^3 \)
\( f'(x) = 12x^3 - 12x^2 \)
\( f''(x) = 36x^2 - 24x \)

Find critical points for f'(x) \( 12x^2 - 12x^2 = 0 \)
\( x(x-1) = 0 \)

Critical points for f'(x): \( 0, 1 \)

Find critical points for f''(x) \( 36x^2 - 24x = 0 \)
\( x(3x - 2) = 0 \)

Critical points for f''(x): \( 0, \frac{2}{3} \)

\( f''(0) = 0 \): this is inconclusive
\( f''(-1) = 12 \)
\( f''(1/3) = -4 \)
\( f''(1) = 12 \)

Answer: \( x < 0 \): concave up, \( 0 < x < 2/3 \): concave down, \( x > 2/3 \): concave up

6. \( f(x) = (x^2-1)/x \)

curve2(function(x) {
    return((x^2 - 1)/x)
}, function(x) {
    return((x^2 + 1)/x^2)
}, function(x) {
    return((-2)/x^3)
}, xlim = c(-5, 5), ylim = c(-5, 5))

plot of chunk unnamed-chunk-17

\( f(x) = (x^2 -1)/x \)
\( f'(x) = (x^2 + 1)/x^2 \)
\( f''(x) = \frac{-2}{x^3} \)

Find critical points for \( f'(x) \)

\( (x^2 + 1)/x^2 = 0 \): x cannot be 0
\( x^2 = -1 \)
\( x = \pm \sqrt{-1} \)

Critical points for \( f'(x) \): \( 0 \)

Find critical points for \( f''(x) \)

\( \frac{-2}{x^3} = 0 \): x cannot be 0, no other critical points

Critical points for \( f''(x) \): \( 0 \)

\( f''(-1) = 2 \)
\( f''(1) = -2 \)

Answer: \( x < 0 \): concave down, \( x > 0 \): concave up

7. \( y = 3x^2 - \frac{1}{x^2} \)

curve2(function(x) {
    return(3 * x^2 - 1/x^2)
}, function(x) {
    return(6 * x + 2/x^3)
}, function(x) {
    return(6 - 6/x^4)
}, xlim = c(-12, 12), ylim = c(-12, 12))

plot of chunk unnamed-chunk-18

\( f(x) = 3x^2 - \frac{1}{x^2} \)
\( f'(x) = 6x + \frac{2}{x^3} \)
\( f''(x) = 6 - \frac{6}{x^4} \)

Find critical points for \( f'(x) \)

\( 6x + \frac{2}{x^3} = 0 \)
\( \frac{6x^4 + 2}{x^3} = 0 \): x cannot be 0
\( 6x^4 = -2 \)
\( x^4 = -\frac{1}{3} \)
Critical points for \( f'(x) \): \( 0 \)

Find critical points for \( f''(x) \)

\( 6 - \frac{6}{x^4} = 0 \): x cannot be 0
\( \frac{1}{x^4} = 0 \)
\( x = \pm 1 \)

Critical points for \( f''(x) \): \( -1, 0, 1 \)

\( f''(-2) = 45/8 \)
\( f''(-0.5) = -90 \)
\( f''(0.5) = -90 \)
\( f''(2) = 45/8 \)

Answer: \( x < -1 \) concave up, \( x > 1 \) concave up, \( -1 < x < 0 \) concave down, \( 0 < x < 1 \) concave down

8. \( y = x^5 - x \)

curve2(function(x) {
    return(x^5 - x)
}, function(x) {
    return(5 * x^4 - 1)
}, function(x) {
    return(20 * x^3)
}, xlim = c(-2, 2), ylim = c(-2, 2))

plot of chunk unnamed-chunk-19

\( f(x) = x^5 - x \)
\( f'(x) = 5x^4 - 1 \)
\( f''(x) = 20x^3 \)

Find critical points for \( f'(x) \)

\( 5x^4 - 1 = 0 \)
\( x^4 = \frac{1}{5} \)
\( x = \pm \sqrt[4]{\frac{1}{5}} \)

Critical points for \( f'(x) \): \( \sqrt[4]{\frac{1}{5}}, -\sqrt[4]{\frac{1}{5}} \)

Find critical points for \( f''(x) \)

\( 20x^3 = 0 \)
\( x = 0 \)

Critical points for \( f''(x) \): \( 0 \)

\( f''(\sqrt[4]{\frac{1}{5}}) = 11.89 \)
\( f''(-\sqrt[4]{\frac{1}{5}}) = -11.89 \)

Answer: \( x < 0 \): concave down, \( x > 0 \): concave up

9. \( y = x + \frac{1}{x} \)

curve2(function(x) {
    return(x + (1/x))
}, function(x) {
    return(1 - (1/x^2))
}, function(x) {
    return(2/(x^3))
}, xlim = c(-5, 5), ylim = c(-5, 5))

plot of chunk unnamed-chunk-20

\( f(x) = x + \frac{1}{x} \)
\( f'(x) = 1 - \frac{1}{x^2} \)
\( f''(x) = \frac{2}{x^3} \)

Find critical points for \( f'(x) \)

\( 1 - \frac{1}{x^2} = 0 \)
\( 1 = \frac{1}{x^2} \)
\( x^2 = 1 \)

Critical points for \( f'(x) \): \( -1, 1 \)

Find critical points for \( f''(x) \)

\( \frac{2}{x^3} = 0 \)

Critical points for \( f''(x) \): \( 0 \)

Note that in this problem, the only critical point for \( f''(x) \) is a point at which \( f''(x) \) is undefined. Therefore, we only need to check for concavity on either side of this single critical point.

\( f''(-1) = -2/3 \)
\( f''(1) = 2/3 \)

Answer: \( x < 0 \): concave down, \( x > 0 \): concave up

10. \( y = x^2 + \frac{1}{x} \)

curve2(function(x) {
    return(x^2 + (1/x))
}, function(x) {
    return(2 * x - (1/x^2))
}, function(x) {
    return(2 + 2/(x^3))
}, xlim = c(-5, 5), ylim = c(-5, 5))

plot of chunk unnamed-chunk-21

\( f(x) = x^2 + \frac{1}{x} \)
\( f'(x) = 2x - \frac{1}{x^2} \)
\( f''(x) = 2 + \frac{2}{x^3} \)

Find critical points for \( f'(x) \)

\( 2x - \frac{1}{x^2} = 0 \)
\( \frac{2x^3 - 1}{x^2} = 0 \): x cannot be zero
\( 2x^3 - 1 = 0 \)
\( x^3 = 1/2 \)
\( x = \sqrt[3]{1/2} \)

Critical points for \( f'(x) \): \( 0, \sqrt[3]{1/2} \)

Find critical points for \( f''(x) \)

\( 2 + \frac{2}{x^3} = 0 \)
\( \frac{2}{x^3} = -2 \)
\( x^3 = -1 \)
\( x = -1 \)

Critical points for \( f''(x) \): \( -1 \)

\( f''(0) \) is undefined \( f''(\sqrt[3]{1/2}) = 4.52 \)

\( f''(-2) = 1.75 \)
\( f''(-0.5) = -14 \)
\( f''(1) = 4 \)

Answer: \( x > 0 \): concave up, \( x < -1 \): concave up, \( -1 < x < 0 \): concave down

4.4 The Second Derivative Test

Theorem 4.4.1 (Second Derivative Test)

Suppose that \( f''(x) \) is continuous on an open interval and that \( f'(a) = 0 \) for some point in that interval.

Find all local maximum and minimum points by the second derivative test.

Black lines are \( f(x) \), red lines are \( f'(x) \), green lines are \( f''(x) \).

1. \( y = x^2 - x \)

curve2(function(x) {
    return(x^2 - x)
}, function(x) {
    return(2 * x - 1)
}, function(x) {
    return(2 * (x/x))
}, xlim = c(-5, 5), ylim = c(-5, 5))

plot of chunk unnamed-chunk-22

\( f(x) = x^2 - x \) \( f'(x) = 2x - 1 \) \( f''(x) = 2 \)

Critical points for \( f'(x) \): \( 1/2 \)

\( f''(1/2) = 2 \)

Local minimum at \( x=1/2 \)

2. \( y = 2 + 3x - x^3 \)

curve2(function(x) {
    return(-x^3 + 3 * x + 2)
}, function(x) {
    return(-3 * x^2 + 3)
}, function(x) {
    return(-6 * x)
}, xlim = c(-2.5, 2.5), ylim = c(-5, 5))

plot of chunk unnamed-chunk-23

\( f(x) = -x^3 + 3x + 2 \)
\( f'(x) = -3x^2 + 3 \)
\( f''(x) = -6x \)

Critical points for \( f'(x) \): \( -1, 1 \)

\( f''(-1) = 6 \)
\( f''(1) = -6 \)

Local minimum at \( -1 \), local maximum at \( 1 \)

3. \( y = x^3 - 9x^2 + 24x \)

curve2(function(x) {
    return(x^3 - 9 * x^2 + 24 * x)
}, function(x) {
    return(3 * x^2 - 18 * x + 24)
}, function(x) {
    return(6 * x - 18)
}, xlim = c(-1, 10), ylim = c(-40, 40))

plot of chunk unnamed-chunk-24

\( f(x) = x^3 - 9x^2 + 24x \)
\( f'(x) = 3x^2 - 18x + 24 \)
\( f''(x) = 6x - 18 \)

Critical points for \( f'(x) \): \( 2, 4 \)

\( f''(2) = -6 \)
\( f''(4) = 6 \)

Local maximum at \( x=2 \), local minimum at \( x=4 \)

4. \( y = x^4 - 2x^2 + 3 \)

curve2(function(x) {
    return(x^4 - 2 * x^2 + 3)
}, function(x) {
    return(4 * x^3 - 4 * x)
}, function(x) {
    return(12 * x^2 - 4)
}, xlim = c(-4, 4), ylim = c(-4, 4))

plot of chunk unnamed-chunk-25

\( f(x) = x^4 - 2x^2 + 3 \)
\( f'(x) = 4x^3 - 4x \)
\( f''(x) = 12x^2 - 4 \)

Critical points for \( f'(x) \): \( 0, -1, 1 \)

\( f''(0) = -4 \)
\( f''(-1) = 8 \)
\( f''(1) = 8 \)

Local maximum at \( x=0 \), local minimum at \( x=1 \) and \( x=-1 \)

5. \( y = 3x^4 - 4x^3 \)

curve2(function(x) {
    return(3 * x^4 - 4 * x^3)
}, function(x) {
    return(12 * x^3 - 12 * x^2)
}, function(x) {
    return(36 * x^2 - 24 * x)
}, xlim = c(-4, 4), ylim = c(-4, 4))

plot of chunk unnamed-chunk-26

\( f(x) = 3x^4 - 4x^3 \)
\( f'(x) = 12x^3 - 12x^2 \)
\( f''(x) = 36x^2 - 24x \)

Critical points for \( f'(x) \): \( 0, 1 \)

\( f''(0) = 0 \)
\( f''(1) = 12 \)

Local minimum at \( x=1 \)

6. \( y = (x^2-1)/x \)

curve2(function(x) {
    return((x^2 - 1)/x)
}, function(x) {
    return((x^2 + 1)/x^2)
}, function(x) {
    return(-2/x^3)
}, xlim = c(-4, 4), ylim = c(-4, 4))

plot of chunk unnamed-chunk-27

\( f(x) = (x^2-1)/x \)
\( f'(x) = (x^2+1)/x^2 \)
\( f''(x) = \frac{-2}{x^3} \)

Critical points for \( f'(x) \): \( 0 \)

\( f''(0) \) is undefined

No extrema

7. \( y = 3x^2 - \frac{1}{x^2} \)

curve2(function(x) {
    return(3 * x^2 - 1/x^2)
}, function(x) {
    return(6 * x + 2/x^3)
}, function(x) {
    return(6 - 6/x^4)
}, xlim = c(-12, 12), ylim = c(-12, 12))

plot of chunk unnamed-chunk-28

\( f(x) = 3x^2 - \frac{1}{x^2} \)
\( f'(x) = 6x + \frac{2}{x^3} \)
\( f''(x) = 6 - \frac{6}{x^4} \)

Critical points for \( f'(x) \): \( 0 \)

\( f''(0) \) is undefined

No extrema

8. \( y = x^5 - x \)

curve2(function(x) {
    return(x^5 - x)
}, function(x) {
    return(5 * x^4 - 1)
}, function(x) {
    return(20 * x^3)
}, xlim = c(-3, 3), ylim = c(-3, 3))

plot of chunk unnamed-chunk-29

\( f(x) = x^5 - x \)
\( f'(x) = 5x^4 - 1 \)
\( f''(x) = 20x^3 \)

Critical points for \( f'(x) \): \( -\sqrt[4]{1/5}, \sqrt[4]{1/5} \)

\( f''(-\sqrt[4]{1/5}) = -5.981 \)
\( f''(\sqrt[4]{1/5}) = 5.981 \)

Local maximum at \( -\sqrt[4]{1/5} \), local minimum at \( \sqrt[4]{1/5} \)

9. \( y = x + 1/x \)

curve2(function(x) {
    return(x + 1/x)
}, function(x) {
    return(1 - 1/x^2)
}, function(x) {
    return(2/x^3)
}, xlim = c(-3, 3), ylim = c(-3, 3))

plot of chunk unnamed-chunk-30

\( f(x) = x + 1/x \)
\( f'(x) = 1 - 1/x^2 \)
\( f''(x) = 2/x^3 \)

Critical points for \( f'(x) \): \( -1, 1 \)

\( f''(-1) = -2 \)
\( f''(1) = 2 \)

Local maximum at \( x=-2 \), local minimum at \( x=1 \)

10. \( y = x^2 + 1/x \)

curve2(function(x) {
    return(x^2 + (1/x))
}, function(x) {
    return(2 * x - (1/x^2))
}, function(x) {
    return(2 + 2/(x^3))
}, xlim = c(-4, 4), ylim = c(-4, 7))

plot of chunk unnamed-chunk-31

\( f(x) = x^2 + \frac{1}{x} \)
\( f'(x) = 2x - \frac{1}{x^2} \)
\( f''(x) = 2 + \frac{2}{x^3} \)

Critical points for \( f'(x) \): \( 0, \sqrt[3]{1/2} \)

\( f''(0) \) is undefined
\( f''(\sqrt[3]{1/2}) = 6 \)

Local minimumn at \( x=\sqrt[3]{1/2} \)

5. The Product Rule and Quotient Rule

5.1 The Product Rule

Theorem 5.1.1 (The Product Rule)

If \( f(x) \) and \( g(x) \) are differentiable, then \( \frac{d}{dx}f(x)g(x) = f(x)g'(x) + f'(x)g(x) \).

1. \( \frac{d}{dx} x^3(x^3 - 5x + 10) \)

\( f'(x) = 3x^2(x^3 - 5x + 10) + x^3(3x^2 - 5) \)

2. \( \frac{d}{dx}(x^2+5x-3)(x^5-6x^3+3x^2-7x+1) \)

\( f'(x) = (2x+5)(x^5-6x^3+3x^2-7x+1) + (x^2+5x-3)(5x^4-18x^2-7) \)

3. \( \frac{d}{dx} e^{2x} = \frac{d}{dx} (e^x \cdot e^x) \)

\( f'(x) = e^x \cdot e^x + e^x \cdot e^x = 2(e^x)^2 = 2e^{2x} \)

A simpler way to do this is to say that \( \frac{d}{dx} e^{\text{stuff}} = e^{\text{stuff}} \cdot \frac{d}{dx} \text{stuff} \), and since “stuff” here is \( 2x \), the answer is \( 2 \cdot e^{2x} \). But this looks ahead to the chain rule.

4. \( \frac{d}{dx} e^{3x} \)

\( f'(x) = \frac{d}{dx} (e^3 \cdot e^x \cdot e^x) = 3e^{3x} \)

I won't bother writing out all of the tedious multiplications.

5. \( \frac{d}{dx} 3x^2e^{4x} \)

\( f'(x) = 6x \cdot e^{4x} + 3x^2 * 4e^{4x} = 6xe^{4x} + 12x^2e^{4x} \)

6. \( \frac{d}{dx} \frac{3e^x}{x^16} \)

\( f'(x) = 3e^x\cdot-16x^{-17} + 3e^x\cdot x^-16 = \frac{-48e^x}{x^17} + \frac{3e^x}{x^16} \)

7. Use the product rule to compute the derivative of \( f(x) = (2x-3)^2 \) with respect to \( x \). Sketch the function. Find an equation of the tangent line to the curve at \( x=2 \). Sketch the tangent line at \( x=2 \).

\( f'(x) = (2)(2x-3) + (2x-3)(2) = 4(2x-3) = 8x-12 \)

Tangent line: The slope is \( f'(2) = 8(2)-12 = 4 \). A point is at \( x=2 \), \( y=(2(2)-3)^2) = 1 \). The tangent line is \( (y-1) = 4(x-2) \) or \( y=4x-7 \)

\( f(x) \) is black, \( f'(x) \) is red, tangent line is blue.

curve2(function(x) {
    return((2 * x - 3)^2)
}, function(x) {
    return(8 * x - 12)
})
f <- function(x) {
    return(4 * x - 7)
}
par(new = T)
curve(f, xlim = c(-5, 5), ylim = c(-2, 8), col = "blue", xlab = "", ylab = "")

plot of chunk unnamed-chunk-32

Use the following table to compute solve the next 4 problems. Note \( \frac{d}{dx}f(x)|_{x=a} \) is the derivative of \( f(x) \) evaluted at \( x=a \).

library(knitr)
df <- data.frame(c(-2, -1, 1, 2), c(-3, 0, 4, -1), c(1, 3, 2, -2), c(4, 5, -1, 
    -3))
rownames(df) <- c("f(x)", "f'(x)", "g(x)", "g'(x)")
names(df) <- c("1", "2", "3", "4")
df
##        1  2  3  4
## f(x)  -2 -3  1  4
## f'(x) -1  0  3  5
## g(x)   1  4  2 -1
## g'(x)  2 -1 -2 -3

8. \( \frac{d}{dx}f(x)g(x)|_{x=2} \)

\( (0)(4) + (-3)(-1) = 3 \)

9. \( \frac{d}{dx}xf(x)|_{x=3} \)

I think the answers must e wrong for 9 and 10. \( \frac{d}{dx}xf(x)|_{x=3} \) would be the value of \( x \) times \( f'(x) \), which would be \( 3\cdot 3=9 \). But the book says 10, and for 10, the answer should be \( -12 \) but the book says \( -13 \).

\( (1)(3) = 9 \)

10. \( \frac{d}{dx}xg(x)|_{x=4} \)

\( (4)(-3)=-12 \)

11. \( \frac{d}{dx}f(x)g(x)|_{x=1} \)

\( (-1)(1) + (-2)(2) = -5 \)

12. Suppose that \( f(x) \), \( g(x) \) and \( h(x) \) are differentiable functions. Show that \( \frac{d}{dx}f(x)\cdot g(x) \cdot h(x) = f(x)g(x)h'(x) + f(x)g'(x)h(x) + f'(x)g(x)h(x) \)

\( \frac{d}{dx}f(x)g(x)h(g) = (f'(x) \cdot (g(x)h(x))) + f(x) \cdot \frac{d}{dx}g(x)h(g) \) \( = (f'(x) \cdot (g(x)h(x))) + f(x)[(g'(x)h(x)) + (g(x)h'(x))] \) \( =f(x)g(x)h'(x) + f(x)g'(x)h(x) + f'(x)g(x)h(x) \)

5.2 The Quotient Rule

Theorem 5.2.1 The Quotient Rule

If \( f(x) \) and \( g(x) \) are differentiable, then

\[ \frac{d}{dx}\frac{f(x)}{g(x)} = \frac{f'(x)g(x) - f(x)g(x)}{g(x)^2} \]

1. \( \frac{x^3}{(x^3-5x+10)} \)

\( f'(x) = \frac{(3x^2)(x^3-5x+10) - (x^3)(3x^2-5)}{(x^3-5x+10)^2} \)

2. \( \frac{x^2+5x-3}{x^5-6x^3+3x^2-7x+1} \)

\( f'(x) = \frac{(2x+5)(x^5-6x^3+3x^2-7x+1) - (x^2+5x-3)(5x^4-18x^2+6x-7)}{(x^5-6x^3+3x^2-7x+1)^2} \)

Some notes on trig

First note that \( \lim_{h \to 0} \sin(h) = 1 \). Picture a graph. As \( h \) continues to grow smaller, the \( \sin \), or the y value, continues to become more and more like the arc length, or \( h \). So \( \sin(h) \) approaches \( 0 \) as \( h \) approaches \( 0 \). But \( h \) never actually reaches \( 0 \). \( \sin(h) \) approaches \( h \) as \( h \) approaches \( 0 \).

As a result of this, \( \lim_{h \to 0} \sin(h) = 1 \).

For similar reasons, \( \lim_{h \to 0} \cos(h) -1 = 0 \). As \( h \) approaches \( 0 \), \( \cos(h) \) approaches \( 1 \), so \( \cos(h) - 1 \) approaches \( 0 \). However, I have not yet figured out how to easily visualize this, because the \( x \) value, or \( \cos(h) \) in a unit circle, is not compared to the angle. I think it involves looking at the same angle at the top of the curve (90 degrees minus \( h \)), near \( y=0 \), and imagining that, as \( h \) approaches 90 degrees, the \( x \) value, or \( \cos \), gets smaller and smaller, and gradually approaches the arc length. So it approaches 1, and therefore that value minus 1 is 0.

The trick is to remember that \( \cos(h) = \sin(90-h) \). So now, as \( h \) approaches \( 0 \), the angle approaches \( 90 \). So \( \lim_{h \to 0} \cos(h) \) = \( \lim_{h \to 0} \sin(90 - h) = 1 \). The graph would show that the arc length becomes more and more similar to the \( x \) value as \( h \) approaches \( 0 \). Therefore, \( \lim_{h \to 0} \cos{h} - 1 = 1 - 1 = 0 \).

One small example of my slowly-developing ability to think mathematically!

Second, there is a trig identity for which I need to establish the proof, and it is \( \sin(\alpha + \theta) = \cos(\alpha)\sin(\theta) + sin(\alpha)\cos(\theta) \).

These combined lead to the proof for \( \frac{d}{dx} \sin(x) \):

\[ \frac{d}{dx} \sin(x) = \lim_{h \to 0} \frac{\sin(x + h)-\sin(x)}{h} \] \[ =\lim_{h \to 0} \frac{\sin(x)\cos(h) + \sin(h)\cos(x) - \sin(x)}{h} \] \[ =\lim_{h \to 0} \frac{\sin(x)\cos(h) - \sin(x)}{h} + \frac{\sin(h)\cos(x)}{h} \] \[ =\lim_{h \to 0} \sin(x)\frac{\cos(h)-1}{h} + \cos(x)\frac{\sin(h)}{h} \] \[ =\sin(x)(\lim_{h \to 0} \frac{\cos(h)-1}{h}) + \cos(x)(\lim_{h \to 0} \frac{\sin(h)}{h}) \] \[ =\sin(x) \cdot 0 + \cos(x) \cdot {1} \] \[ =\cos(x) \]