---
title: "Differentiation: A First Course"
book: "High School Mathematics"
subject: math
language: en
chapter: 12
exercises: 12
source: https://one-course.com/books/math/2/en/chapter/12-differentiation-a-first-course
---

# Chapter 12 — Differentiation: A First Course

How fast does a [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) change? The answer at a single point is the *[derivative](#def-g11-deriv-derivative)*, the single most useful number in all of applied mathematics. This chapter constructs it from average rates of change, computes it for the [reference functions](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-reference), and uses its sign to read the variations of a [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function). Everything here is extended and deepened in [Chapter 22](https://one-course.com/books/math/2/en/chapter/22-differentiation-and-convexity#ch-g12-deriv).

## 12.1 The average rate of change

**Definition 12.1 (Average rate of change).**

Let $f$ be defined on an [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) $I$, and $a \neq b$ in $I$. The *average rate of change* of $f$ between $a$ and $b$ is

$$
\frac{f(b) - f(a)}{b - a}.
$$

It is the [slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) of the *secant* line through the points $\bigl(a, f(a)\bigr)$ and $\bigl(b, f(b)\bigr)$ of the curve.

**Example 12.2.**

A car travels $140$ km between 2 p.m. and 4 p.m.: its average speed is $\frac{140}{2} = 70$ km/h. The speedometer, however, displays an *instantaneous* speed at every moment — that is exactly the notion that the [derivative](#def-g11-deriv-derivative) makes precise.

## 12.2 The derivative at a point

**Definition 12.3 (Derivative at a point).**

Let $f$ be defined on an [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) containing $a$. For $h \neq 0$, form the [average rate of change](#def-g11-deriv-rate) between $a$ and $a + h$:

$$
r(h) = \frac{f(a+h) - f(a)}{h}.
$$

If $r(h)$ approaches a single fixed number as $h$ gets arbitrarily close to $0$, we say that $f$ is *differentiable at $a$*; this number is the *derivative of $f$ at $a$*, written $f'(a)$:

$$
f'(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}.
$$

**Example 12.4.**

Let $f(x) = x^2$ and $a = 1$. For $h \neq 0$:

$$
\frac{f(1+h) - f(1)}{h}
= \frac{(1+h)^2 - 1}{h}
= \frac{1 + 2h + h^2 - 1}{h}
= \frac{h(2 + h)}{h}
= 2 + h .
$$

As $h$ approaches $0$, this approaches $2$: the [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) $x^2$ is [differentiable](#def-g11-deriv-derivative) at $1$ and $f'(1) = 2$. Note the strategy: *simplify the quotient until $h$ no longer appears in a denominator*, then let $h \to 0$.

**Example 12.5 (A non-differentiable point).**

Let $f(x) = \abs{x}$ and $a = 0$. Then $\frac{f(h) - f(0)}{h} = \frac{\abs h}{h}$, which equals $1$ for $h > 0$ and $-1$ for $h < 0$: no single number is approached, and $\abs x$ is not [differentiable](#def-g11-deriv-derivative) at $0$. Its curve has a *corner* there.

## 12.3 The tangent line

**Definition 12.6 (Tangent).**

If $f$ is [differentiable](#def-g11-deriv-derivative) at $a$, the *tangent* to the curve at the point $A = \bigl(a, f(a)\bigr)$ is the line through $A$ with [slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) $f'(a)$. Its [equation](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-equation) is

$$
y = f(a) + f'(a)(x - a).
$$

The [tangent](#def-g11-deriv-tangent) is the limiting position of the [secants](#def-g11-deriv-rate) through $A$: as $h \to 0$, the second point $\bigl(a+h, f(a+h)\bigr)$ slides along the curve towards $A$, and the [secant](#def-g11-deriv-rate)’s [slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) $\frac{f(a+h)-f(a)}{h}$ approaches $f'(a)$.

![The secant through A and B = (a+h, f(a+h) ) has slope f(a+h)-f(a)/h. As B slides towards A, the secant tilts into the tangent, whose slope is f'(a).](https://one-course.com/images/onecourse/chapters/math-2/g11-deriv/fig-1f2e8b16b06c.svg)

*The [secant](#def-g11-deriv-rate) through $A$ and $B = \bigl(a+h, f(a+h)\bigr)$ has [slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) $\frac{f(a+h)-f(a)}{h}$. As $B$ slides towards $A$, the [secant](#def-g11-deriv-rate) tilts into the [tangent](#def-g11-deriv-tangent), whose [slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) is $f'(a)$.*

**Example 12.7.**

For $f(x) = x^2$ at $a = 1$: $f(1) = 1$ and $f'(1) = 2$ ([Example 12.4](#ex-g11-deriv-atpoint)), so the [tangent](#def-g11-deriv-tangent) is

$$
y = 1 + 2(x - 1) = 2x - 1 .
$$

This is the line $d_2$ found by pure algebra in [Exercise 10.11](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#exo-g11-quad-11).

## 12.4 Derivatives of the reference functions

**Proposition 12.8.**

On their [domains](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) of differentiability:

$$
(c)' = 0, \quad
(x)' = 1, \quad
(x^2)' = 2x, \quad
(x^3)' = 3x^2, \quad
\left(\frac1x\right)' = -\frac{1}{x^2}, \quad
(\sqrt x\,)' = \frac{1}{2\sqrt x} \ (x > 0).
$$

More generally, $(x^n)' = n\,x^{n-1}$ for every [integer](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-sets) $n \geq 1$.

**Proof.** Each proof follows the strategy of [Example 12.4](#ex-g11-deriv-atpoint): simplify the rate, then let $h \to 0$. Fix $a$ in the [domain](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function).

*Constant and identity.* $\frac{c - c}{h} = 0$ and $\frac{(a+h) - a}{h} = 1$ for all $h$: the limits are $0$ and $1$.

*Square.* $\frac{(a+h)^2 - a^2}{h} = \frac{2ah + h^2}{h} = 2a + h
\to 2a$.

*Cube.* $(a+h)^3 = a^3 + 3a^2h + 3ah^2 + h^3$, so the rate is $3a^2 + 3ah + h^2 \to 3a^2$.

*Reciprocal.* For $a \neq 0$ and $h$ small enough that $a + h \neq 0$:

$$
\frac{1}{h}\left(\frac{1}{a+h} - \frac{1}{a}\right)
= \frac{1}{h} \cdot \frac{a - (a+h)}{a(a+h)}
= \frac{-1}{a(a+h)}
\xrightarrow[h \to 0]{} -\frac{1}{a^2}.
$$

*Square root.* For $a > 0$, multiply by the conjugate:

$$
\frac{\sqrt{a+h} - \sqrt a}{h}
= \frac{(a + h) - a}{h\,(\sqrt{a+h} + \sqrt a)}
= \frac{1}{\sqrt{a+h} + \sqrt a}
\xrightarrow[h \to 0]{} \frac{1}{2\sqrt a}.
$$

*General power.* The pattern $2a$, $3a^2$ continues: [expanding](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-expand) $(a+h)^n$, the terms after $a^n + n\,a^{n-1}h$ all carry $h^2$, so the rate tends to $n\,a^{n-1}$. (A complete induction is given in [Chapter 22](https://one-course.com/books/math/2/en/chapter/22-differentiation-and-convexity#ch-g12-deriv).) ∎

## 12.5 Differentiation rules

**Theorem 12.9 (Operations).**

Let $u$ and $v$ be [differentiable](#def-g11-deriv-derivative) on $I$ and $\lambda \in \R$. Then $u + v$, $\lambda u$, $uv$ are [differentiable](#def-g11-deriv-derivative) on $I$, as is $\frac{u}{v}$ wherever $v \neq 0$, and

$$
(u+v)' = u' + v', \qquad
(\lambda u)' = \lambda u', \qquad
(uv)' = u'v + uv', \qquad
\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2}.
$$

**Proof of the first three rules.** Fix $a \in I$ and abbreviate $\Delta u = u(a+h) - u(a)$, $\Delta v = v(a+h) - v(a)$.

*Sum.* The rate of $u + v$ is $\frac{\Delta u + \Delta v}{h} = \frac{\Delta u}{h} + \frac{\Delta v}{h}
\to u'(a) + v'(a)$.

*Multiple.* The rate of $\lambda u$ is $\lambda \frac{\Delta u}{h} \to \lambda u'(a)$.

*Product.* Add and subtract the mixed term $u(a+h)\,v(a)$:

$$
\begin{align*}
\frac{u(a+h)v(a+h) - u(a)v(a)}{h}
&= \frac{u(a+h)v(a+h) - u(a+h)v(a) + u(a+h)v(a) - u(a)v(a)}{h}\\
&= u(a+h)\,\frac{\Delta v}{h} + v(a)\,\frac{\Delta u}{h}.
\end{align*}
$$

As $h \to 0$: $\frac{\Delta v}{h} \to v'(a)$, $\frac{\Delta u}{h} \to
u'(a)$, and $u(a+h) \to u(a)$ (its rate has a limit, so $\Delta u = h \cdot \frac{\Delta u}{h} \to 0$). The rate therefore tends to $u(a)v'(a) + v(a)u'(a)$.

The quotient rule is proved along the same lines; it is *admitted at this level* and proved in [Chapter 22](https://one-course.com/books/math/2/en/chapter/22-differentiation-and-convexity#ch-g12-deriv). ∎

**Example 12.10.**

*Polynomial.* $f(x) = 3x^3 - 5x^2 + 7x - 2$:

$$
f'(x) = 3 \times 3x^2 - 5 \times 2x + 7 = 9x^2 - 10x + 7 .
$$

*Quotient.* $g(x) = \frac{2x+1}{x^2+1}$: with $u = 2x + 1$, $v = x^2
+ 1$,

$$
g'(x) = \frac{2(x^2+1) - (2x+1)\,2x}{(x^2+1)^2}
= \frac{-2x^2 - 2x + 2}{(x^2+1)^2}.
$$

*Product.* $k(x) = x\sqrt x$ for $x > 0$: $k'(x) = 1 \times \sqrt x + x \times \frac{1}{2\sqrt x}
= \sqrt x + \frac{\sqrt x}{2} = \frac{3\sqrt x}{2}$.

## 12.6 Sign of the derivative and variations

**Theorem 12.11 (Derivative and variations).**

Let $f$ be [differentiable](#def-g11-deriv-derivative) on an [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) $I$.

1. If $f' \geq 0$ on $I$ , then $f$ is [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $I$ .
2. If $f' \leq 0$ on $I$ , then $f$ is [decreasing](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-variations) on $I$ .
3. If $f' > 0$ on $I$ (except possibly at finitely many points where it vanishes), then $f$ is strictly [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $I$ .

**Proof.** The intuition is clear — a curve whose [tangents](#def-g11-deriv-tangent) all point upward must climb — but a rigorous proof needs the [mean](https://one-course.com/books/math/2/en/chapter/8-descriptive-statistics#def-g10-stats-mean) value theorem. The result is *admitted at this level*; see [Theorem 22.7](https://one-course.com/books/math/2/en/chapter/22-differentiation-and-convexity#thm-g12-deriv-variations). ∎

**Proposition 12.12 (Extrema).**

If $f'$ changes sign at $a$ from $+$ to $-$, then $f$ has a local [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) at $a$; from $-$ to $+$, a local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema). At such a point, $f'(a) = 0$ and the [tangent](#def-g11-deriv-tangent) is horizontal.

**Proof.** If $f' \geq 0$ on an [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) ending at $a$ and $f' \leq 0$ on an [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) starting at $a$, then $f$ increases up to $f(a)$ and decreases afterwards ([Theorem 12.11](#thm-g11-deriv-variations)): $f(a)$ is largest nearby. Since $f'$ changes sign at $a$ and is defined there, $f'(a) = 0$. ∎

**Method 12.13 (Studying a function).**

1. Compute $f'(x)$ and simplify it — ideally into a factored form.
2. Determine the sign of $f'(x)$ on each [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) (for a quadratic $f'$ , use [Theorem 10.11](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#thm-g11-quad-sign) ).
3. Record the results in a *[variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table)* : one row for the sign of $f'$ , one row of arrows for $f$ , with the values of $f$ at the turning points.
4. Conclude: extrema, number of solutions of $f(x) = k$ , inequalities.

**Example 12.14.**

Study $f(x) = x^3 - 3x + 1$ on $\R$. First, $f'(x) = 3x^2 - 3 = 3(x-1)(x+1)$: a quadratic with [roots](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-discriminant) $-1$ and $1$, positive outside them. So $f$ is [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $\intoc{-\infty}{-1}$, [decreasing](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-variations) on $\intcc{-1}{1}$, [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $\intco{1}{+\infty}$, with a local [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(-1) = -1 + 3 + 1 = 3$ and a local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(1) = 1 - 3 + 1 = -1$.

![The curve of f(x) = x3 - 3x + 1 (): horizontal tangents (orange) at the local maximum (-1, 3) and the local minimum (1, -1), where f' changes sign.](https://one-course.com/images/onecourse/chapters/math-2/g11-deriv/fig-7cf7eb7be937.svg)

*The curve of $f(x) = x^3 - 3x + 1$ ([Example 12.14](#ex-g11-deriv-study)): horizontal [tangents](#def-g11-deriv-tangent) (orange) at the local [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $(-1, 3)$ and the local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $(1, -1)$, where $f'$ changes sign.*

**Example 12.15 (Optimization).**

An open box is made from a $12 \times 12$ cm sheet by cutting a square of side $x$ from each corner and folding. Its volume is $V(x) = x(12 - 2x)^2$ for $0 < x < 6$. [Expanding](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-expand), $V(x) = 4x^3 - 48x^2 + 144x$, so

$$
V'(x) = 12x^2 - 96x + 144 = 12(x^2 - 8x + 12) = 12(x - 2)(x - 6).
$$

On $\intoo{0}{6}$, the factor $x - 6$ is negative, so $V'(x)$ has the sign of $-(x-2)$: positive before $2$, negative after. The volume is maximal for $x = 2$ cm, giving $V(2) = 2 \times 8^2 = 128$ cm$^3$.

## 12.7 Exercises

**Exercise 12.1 ★.**

Using the definition (rate of change, then $h \to 0$), compute $f'(2)$ for $f(x) = x^2$, then $g'(1)$ for $g(x) = x^2 + 3x$.

**Solution of Exercise 12.1.**

For $f(x) = x^2$ at $a = 2$:

$$
\frac{(2+h)^2 - 4}{h} = \frac{4h + h^2}{h} = 4 + h
\xrightarrow[h\to0]{} 4,
$$

so $f'(2) = 4$. For $g(x) = x^2 + 3x$ at $a = 1$: $g(1) = 4$ and

$$
\frac{(1+h)^2 + 3(1+h) - 4}{h} = \frac{5h + h^2}{h} = 5 + h
\xrightarrow[h\to0]{} 5,
$$

so $g'(1) = 5$.

**Exercise 12.2 ★.**

Differentiate:

$$
f(x) = 4x^3 - 2x^2 + x - 7, \qquad
g(x) = 5\sqrt{x} + \frac{3}{x}, \qquad
h(x) = (2x+1)(x^2 - 3) .
$$

**Solution of Exercise 12.2.**

$f'(x) = 12x^2 - 4x + 1$.

$g'(x) = \frac{5}{2\sqrt x} - \frac{3}{x^2}$ (on $\intoo{0}{+\infty}$).

$h'(x) = 2(x^2 - 3) + (2x+1)(2x) = 2x^2 - 6 + 4x^2 + 2x
= 6x^2 + 2x - 6$ (product rule).

**Exercise 12.3 ★.**

Give the [equation](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-equation) of the [tangent](#def-g11-deriv-tangent) to the curve of $f$ at the point of [abscissa](https://one-course.com/books/math/2/en/chapter/5-coordinate-geometry#def-g10-coordgeom-system) $a$:

$$
f(x) = x^2 - 3x, \ a = 2; \qquad
f(x) = \frac1x, \ a = 1; \qquad
f(x) = \sqrt x, \ a = 4 .
$$

**Solution of Exercise 12.3.**

$f(x) = x^2 - 3x$, $a = 2$: $f(2) = -2$, $f'(x) = 2x - 3$ so $f'(2) = 1$; [tangent](#def-g11-deriv-tangent) $y = -2 + (x - 2) = x - 4$.

$f(x) = \frac1x$, $a = 1$: $f(1) = 1$, $f'(1) = -1$; [tangent](#def-g11-deriv-tangent) $y = 1 - (x - 1) = 2 - x$.

$f(x) = \sqrt x$, $a = 4$: $f(4) = 2$, $f'(4) = \frac{1}{2\sqrt4} =
\frac14$; [tangent](#def-g11-deriv-tangent) $y = 2 + \frac14(x - 4) = \frac{x}{4} + 1$.

**Exercise 12.4 ★.**

Differentiate the quotients:

$$
f(x) = \frac{x+2}{x-1}, \qquad
g(x) = \frac{x^2}{x^2+1}, \qquad
h(x) = \frac{1}{x^2 + x + 1} .
$$

**Solution of Exercise 12.4.**

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

$g'(x) = \frac{2x(x^2+1) - x^2 \times 2x}{(x^2+1)^2}
= \frac{2x}{(x^2+1)^2}$.

$h'(x) = -\frac{2x+1}{(x^2+x+1)^2}$ (quotient rule with $u = 1$).

**Exercise 12.5 ★★.**

Study the variations of $f(x) = x^3 - 6x^2 + 9x - 2$ on $\R$ ([variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table), local extrema).

**Solution of Exercise 12.5.**

$f'(x) = 3x^2 - 12x + 9 = 3(x^2 - 4x + 3) = 3(x-1)(x-3)$: positive outside $\intcc{1}{3}$, negative inside. So $f$ is [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $\intoc{-\infty}{1}$, [decreasing](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-variations) on $\intcc{1}{3}$, [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $\intco{3}{+\infty}$, with a local [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(1) = 1 - 6 + 9 - 2 = 2$ and a local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(3) = 27 - 54 + 27 - 2 = -2$.

**Exercise 12.6 ★★.**

Study the variations of $f(x) = \frac{x^2 + 3}{x + 1}$ on $\intoo{-1}{+\infty}$.

**Solution of Exercise 12.6.**

On $\intoo{-1}{+\infty}$:

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

For $x > -1$, both $x + 3$ and $(x+1)^2$ are positive, so $f'(x)$ has the sign of $x - 1$: $f$ is [decreasing](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-variations) on $\intoc{-1}{1}$ and [increasing](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-monotone) on $\intco{1}{+\infty}$, with [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(1) = \frac{4}{2} = 2$.

**Exercise 12.7 ★★.**

Let $f(x) = x^2 - 4x + 5$.

1. Find the point of the curve where the [tangent](#def-g11-deriv-tangent) is horizontal.
2. Find the point(s) where the [tangent](#def-g11-deriv-tangent) is parallel to the line $y = 2x + 1$ .

**Solution of Exercise 12.7.**

$f'(x) = 2x - 4$.

*1.* Horizontal [tangent](#def-g11-deriv-tangent): $f'(x) = 0$ at $x = 2$; the point is $(2, f(2)) = (2, 1)$ (the vertex of the [parabola](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-parabola)).

*2.* Parallel to $y = 2x + 1$ means [slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) $2$: $2x - 4 = 2$, so $x = 3$, giving the point $(3, f(3)) = (3, 2)$.

**Exercise 12.8 ★★.**

A rectangular enclosure is built against a wall with $60$ m of fence (three sides). Express the area as a [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) of the width $x$, and use the [derivative](#def-g11-deriv-derivative) to find the dimensions of maximal area. (Compare with the vertex method of [Chapter 10](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#ch-g11-quad).)

**Solution of Exercise 12.8.**

With width $x$ (two fenced sides) and length $60 - 2x$: $A(x) = x(60 - 2x) = 60x - 2x^2$ on $\intoo{0}{30}$. Then $A'(x) = 60 - 4x$, positive before $x = 15$ and negative after: the area is maximal for $x = 15$, giving a $15 \times 30$ m enclosure of area $450$ m$^2$. The vertex formula $\alpha = -\frac{60}{2 \times (-2)} = 15$ of [Chapter 10](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#ch-g11-quad) gives the same answer without calculus.

**Exercise 12.9 ★★.**

Show that for all $x > 0$, $\sqrt{x} \leq \frac{x + 1}{2}$, by studying the [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) $f(x) = \frac{x+1}{2} - \sqrt x$ on $\intoo{0}{+\infty}$.

**Solution of Exercise 12.9.**

Let $f(x) = \frac{x+1}{2} - \sqrt x$ on $\intoo{0}{+\infty}$. Then

$$
f'(x) = \frac12 - \frac{1}{2\sqrt x} = \frac{\sqrt x - 1}{2\sqrt x},
$$

which has the sign of $\sqrt x - 1$: negative on $\intoo{0}{1}$, positive on $\intoo{1}{+\infty}$. So $f$ decreases then increases, with [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(1) = 1 - 1 = 0$. Hence $f(x) \geq 0$ for all $x > 0$, that is $\sqrt x \leq \frac{x+1}{2}$, with equality only at $x = 1$.

**Exercise 12.10 ★★.**

A cylindrical can must hold $500$ cm$^3$. Its surface area (two disks plus the side) is $S = 2\pi r^2 + 2\pi r h$ with $\pi r^2 h = 500$. Express $S$ as a [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) of $r$ alone, and show that $S'(r) = 4\pi r -
\frac{1000}{r^2}$. Deduce the radius that minimizes the surface, as an exact expression.

**Solution of Exercise 12.10.**

From $\pi r^2 h = 500$, $h = \frac{500}{\pi r^2}$, so

$$
S(r) = 2\pi r^2 + 2\pi r \cdot \frac{500}{\pi r^2}
= 2\pi r^2 + \frac{1000}{r},
\qquad
S'(r) = 4\pi r - \frac{1000}{r^2}.
$$

$S'(r) = 0$ when $4\pi r^3 = 1000$, i.e. $r^3 = \frac{250}{\pi}$, so $r = \sqrt[3]{250/\pi}$ ($\approx 4.3$ cm). Since $S'(r) =
\frac{4\pi r^3 - 1000}{r^2}$ is negative before this value and positive after, it is a [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema).

**Exercise 12.11 ★★★.**

How many [tangents](#def-g11-deriv-tangent) to the [parabola](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-parabola) $y = x^2$ pass through the external point $P(1, -3)$? Determine their [equations](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-equation). (Let $a$ be the [abscissa](https://one-course.com/books/math/2/en/chapter/5-coordinate-geometry#def-g10-coordgeom-system) of the contact point and express that the [tangent](#def-g11-deriv-tangent) at $a$ passes through $P$.)

**Solution of Exercise 12.11.**

The [tangent](#def-g11-deriv-tangent) to $y = x^2$ at the point of [abscissa](https://one-course.com/books/math/2/en/chapter/5-coordinate-geometry#def-g10-coordgeom-system) $a$ is $y = a^2 + 2a(x - a) = 2ax - a^2$. It passes through $P(1, -3)$ when $-3 = 2a - a^2$, i.e. $a^2 - 2a - 3 = 0$, whose [roots](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-discriminant) are $a = 3$ and $a = -1$ ($\Delta = 16$). There are therefore *two* [tangents](#def-g11-deriv-tangent) through $P$:

$$
y = 6x - 9 \quad (a = 3),
\qquad
y = -2x - 1 \quad (a = -1).
$$

**Exercise 12.12 ★★★.**

Let $f(x) = x^3 - 3x + 1$ (see [Example 12.14](#ex-g11-deriv-study)). Using the [variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table), determine the number of solutions of the [equation](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-equation) $f(x) = k$ according to the value of the [real number](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-sets) $k$.

**Solution of Exercise 12.12.**

From [Example 12.14](#ex-g11-deriv-study), $f$ increases up to the local [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(-1) = 3$, decreases to the local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $f(1) = -1$, then increases again; for $x$ large positive (resp. negative), $x^3$ dominates and $f$ takes arbitrarily large (resp. small) values. Reading horizontal lines $y = k$ across the [variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table):

- $k > 3$ or $k < -1$ : the line meets the curve once — $1$ solution;
- $k = 3$ or $k = -1$ : the line touches a turning point and crosses one other branch — $2$ solutions;
- $-1 < k < 3$ : the line crosses all three branches — $3$ solutions.

## 12.8 Problem: The tangent’s three jobs

**Problem 12.1.**

Weekend problem — the parabolic mirror proved, Newton’s root-finding machine, and the strongest beam in the log

A [derivative](#def-g11-deriv-derivative) draws [tangents](#def-g11-deriv-tangent); that sounds like a modest talent. This problem shows the [tangent](#def-g11-deriv-tangent) holding three jobs at once: it proves the headlight theorem left pending in [Problem 10.1](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1) (every ray parallel to a [parabola](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-parabola)’s axis reflects through the [focus](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1)), it powers the fastest equation-solving algorithm in common use — inside every calculator and neural network — and it finds the strongest rectangular beam that a round log can yield.

**Part I — [Tangent](#def-g11-deriv-tangent) fluency.**

1. Differentiate $f(x) = 3x^2 - 5x + 1$ and $g(x) = x^3 - 12x$ ( [Theorem 12.9](#thm-g11-deriv-rules) ); and recover $\left(x^2  \right)'$ at $x = 1$ from the definition (rate of change, then $h \to 0$ ).
2. Find the [tangent](#def-g11-deriv-tangent) to $y = x^3 - 12x$ at $a = 2$ . What is special about it, and what does that signal ( [Proposition 12.12](#prop-g11-deriv-extrema) )?
3. Establish the general [tangent](#def-g11-deriv-tangent) to the [parabola](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-parabola) $y = x^2$ at the point $(a, a^2)$: $$y = 2ax - a^2 .$$
4. Where does that [tangent](#def-g11-deriv-tangent) cross the $y$ -axis? Deduce the draftsman’s recipe: to draw the [tangent](#def-g11-deriv-tangent) at a point $P$ of height $h$ on the [parabola](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-parabola) , join $P$ to the point of the axis at depth … below the origin. State it.
5. Build the complete [variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table) of $g(x) = x^3 - 12x$ (sign of $g'$ , local extrema and their values, [Method 12.13](#met-g11-deriv-study) ).

**Part II — The mirror theorem.** Let $P(a, a^2)$ be a point of the [parabola](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-parabola) $y = x^2$ (take $a \neq 0$), $F\left(0, \frac14\right)$ the [focus](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1), and $T$ the point where the [tangent](#def-g11-deriv-tangent) at $P$ crosses the $y$-axis (question 4). Recall from [Problem 10.1](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1) that $PF = a^2 + \frac14$.

6. Compute the distance $FT$ .
7. Conclude that the triangle $FPT$ is isosceles at $F$ . Which two angles are therefore equal?
8. The incoming ray through $P$ , parallel to the axis, is parallel to the line $(TF)$ (both vertical). Using alternate angles, show that the [tangent](#def-g11-deriv-tangent) at $P$ makes *equal angles* with the incoming vertical ray and with the segment $[PF]$ .
9. Physics: light reflects off a curve as off its [tangent](#def-g11-deriv-tangent) , leaving at the same angle it arrived (the law of reflection). Conclude the *mirror theorem* : every ray parallel to the axis reflects through the [focus](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1) — and, reversing time, a bulb at the [focus](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1) beams out parallel light. The dish and the headlight of [Problem 10.1](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1) are now theorems.
10. Check the isosceles triangle numerically at $a = 1$ : compute $T$ , $FP$ and $FT$ .

**Part III — Newton’s machine.** To solve $f(x) = 0$, Newton proposed: start from a guess $x_0$, follow the [tangent](#def-g11-deriv-tangent) at $x_0$ down to the axis, and let its $x$-intercept be the next guess.

11. Derive the formula of the method: $$x_{n + 1} = x_n - \frac{f(x_n)}{f'(x_n)} .$$
12. Run it on $f(x) = x^2 - 2$ from $x_0 = 1$: compute $x_1$, $x_2$, $x_3$ as exact fractions. Which two-thousand-year-old sequence — and which machine from [Problem 3.1](https://one-course.com/books/math/2/en/chapter/3-functions#pb-g10-functions-1) — have you just rebuilt? Prove the identity behind the coincidence: $$x - \frac{x^2 - 2}{2x} = \frac12\left(x +  \frac2x\right).$$
13. Solve $x^3 = 100$ (the savings crossover of [Problem 4.1](https://one-course.com/books/math/2/en/chapter/4-reference-functions#pb-g10-reffunc-1) ): apply two Newton steps to $f(x) = x^3 - 100$ from $x_0 = 5$ (four decimals), and compare with the calculator’s $\sqrt[3]{100}$ .
14. Sabotage: try to launch the method on $f(x) = x^3 - 12x$ at $x_0 = 2$ . What goes wrong, and why (question 2)? State the practical caveat.
15. In question 12 the correct decimals went roughly $1 \to 3 \to 6$ . Compare with bisection (halving an [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) each step) and say in one sentence why calculators, GPS receivers and neural-network training all run on Newton’s idea.

**Part IV — The strongest beam.** A rectangular beam of width $w$ and depth $d$ is sawn from a round log of diameter $30$ cm, so $w^2 + d^2 = 900$. A beam’s stiffness is proportional to $w d^2$ (depth counts twice: joists stand on edge!).

16. Express the stiffness as a [function](https://one-course.com/books/math/2/en/chapter/11-functions-and-variations#def-g11-func-function) of $w$ alone: $S(w) = 900w - w^3$ , on which [interval](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-interval) ?
17. Differentiate, build the [variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table) , and find the optimal $w$ and $d$ (exact values, then to the millimeter).
18. Show that the optimal proportions satisfy $d = w\sqrt2$ — the old carpenters’ ratio. (Bonus lore: dividing the log’s diameter in three equal parts and raising perpendiculars to the circle constructs exactly this rectangle.)
19. The naive choice is the *square* beam ( $w = d$ ). Compute its stiffness and the optimal beam’s, and give the carpenter’s gain in percent.
20. Finale — the [tangent](#def-g11-deriv-tangent) ’s three jobs, one sentence each: geometry (the mirror theorem), numerics (Newton’s machine), optimization (the beam), all powered by the same object. And the forward pointer: grade 12 adds convexity — the [tangent](#def-g11-deriv-tangent) ’s side of the curve — to sharpen all three.

**Solution of Problem 12.1.**

**1.** $f'(x) = 6x - 5$; $g'(x) = 3x^2 - 12$. Definition: $\frac{(1 + h)^2 - 1}{h} = 2 + h \to 2$: the [derivative](#def-g11-deriv-derivative) of $x^2$ at $1$ is $2$.

**2.** $g(2) = 8 - 24 = -16$ and $g'(2) = 12 - 12 = 0$: the [tangent](#def-g11-deriv-tangent) is the horizontal line $y = -16$. A horizontal [tangent](#def-g11-deriv-tangent) signals a critical point — here a local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema), as the [variation table](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-table) of question 5 confirms.

**3.** [Slope](https://one-course.com/books/math/2/en/chapter/4-reference-functions#def-g10-reffunc-affine) $2a$ at $(a, a^2)$: $y = a^2 + 2a(x - a) = 2ax - a^2$.

**4.** At $x = 0$: $y = -a^2$: the [tangent](#def-g11-deriv-tangent) crosses the axis at depth $a^2$ below the origin — exactly as far *below* zero as $P$ sits above it. Recipe: to draw the [tangent](#def-g11-deriv-tangent) at a point of height $h$, join it to the axis point at depth $h$ below the origin. (No [derivative](#def-g11-deriv-derivative) needed at the drawing board.)

**5.** $g'(x) = 3(x^2 - 4)$: positive on $\intoo{-\infty}{-2}$, negative on $\intoo{-2}{2}$, positive beyond. $g$ increases to a local [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $g(-2) = 16$, falls to a local [minimum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema) $g(2) = -16$, then increases.

**6.** $F\left(0, \frac14\right)$ and $T(0, -a^2)$: $FT = \frac14 + a^2$.

**7.** $FP = a^2 + \frac14 = FT$: isosceles at $F$, so the base angles are equal: $\widehat{FTP} = \widehat{FPT}$.

**8.** The incoming ray at $P$ is vertical, hence parallel to the line $(TF)$ (the $y$-axis). The [tangent](#def-g11-deriv-tangent) $(TP)$ crosses both parallels, so the angle between the ray and the [tangent](#def-g11-deriv-tangent) equals $\widehat{FTP}$ (alternate angles) — which equals $\widehat{FPT}$, the angle between $[PF]$ and the [tangent](#def-g11-deriv-tangent). Equal angles on the two sides of the [tangent](#def-g11-deriv-tangent) at $P$.

**9.** By the law of reflection, the ray arriving vertically at $P$ leaves along the line making the equal angle on the other side — by question 8, along $[PF]$: through the [focus](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#pb-g11-quad-1), whatever $a$ is. Reversed, light born at $F$ leaves every point of the mirror parallel to the axis. Dishes collect, headlights beam: proved.

**10.** $a = 1$: [tangent](#def-g11-deriv-tangent) $y = 2x - 1$, $T(0, -1)$; $FP = \sqrt{1 + \left(1 - \frac14\right)^2} =
\sqrt{\frac{25}{16}} = \frac54$; $FT = \frac14 + 1 = \frac54$: isosceles, as promised.

**11.** The [tangent](#def-g11-deriv-tangent) at $x_n$ is $y = f(x_n) + f'(x_n)(x - x_n)$; it crosses $y = 0$ where $x = x_n - \frac{f(x_n)}{f'(x_n)}$.

**12.** $x_1 = 1 - \frac{-1}{2} = \frac32$; $x_2 = \frac32 - \frac{1/4}{3} = \frac{17}{12}$; $x_3 = \frac{577}{408}$: Heron’s [approximations](https://one-course.com/books/math/2/en/chapter/1-numbers-and-sets-of-numbers#def-g10-numbers-approx) of $\sqrt2$, i.e. the fixed-point machine of [Problem 3.1](https://one-course.com/books/math/2/en/chapter/3-functions#pb-g10-functions-1). Identity: $x - \frac{x^2 - 2}{2x} = \frac{2x^2 - x^2 + 2}{2x}
= \frac{x^2 + 2}{2x} = \frac12\left(x + \frac2x\right)$ — Heron’s recipe *is* Newton’s method applied to $x^2 - 2$, two millennia early.

**13.** $x_1 = 5 - \frac{125 - 100}{75} = \frac{14}{3}
\approx 4.6667$; $x_2 \approx 4.6667 - \frac{1.63}{65.33}
\approx 4.6417$. Calculator: $\sqrt[3]{100} = 4.6416\ldots$ — four correct decimals in two steps.

**14.** $f'(2) = 0$: the [tangent](#def-g11-deriv-tangent) at the starting point is horizontal (question 2) and never crosses the axis — the formula divides by zero. Caveat: start Newton away from critical points (and, more generally, close enough to the [root](https://one-course.com/books/math/2/en/chapter/10-quadratic-functions-and-equations#def-g11-quad-discriminant) you want).

**15.** Bisection gains one binary digit per step; Newton roughly *doubles* the number of correct digits each step ($1 \to 3 \to 6$ here). When each step is costly — millions of parameters, real-time navigation — doubling beats inching, which is why the [tangent](#def-g11-deriv-tangent) line runs inside so much silicon.

**16.** $d^2 = 900 - w^2$, so $S(w) = w(900 - w^2) = 900w - w^3$, for $0 < w < 30$.

**17.** $S'(w) = 900 - 3w^2 = 0$ at $w = \sqrt{300} = 10\sqrt3 \approx 17.3$ cm ($S' > 0$ before, $< 0$ after: a [maximum](https://one-course.com/books/math/2/en/chapter/3-functions#def-g10-functions-extrema)). Then $d = \sqrt{600} = 10\sqrt6 \approx 24.5$ cm.

**18.** $\frac{d^2}{w^2} = \frac{600}{300} = 2$, so $d = w\sqrt2$: depth is width times $\sqrt2$ — the carpenter’s ratio (and the diameter-in-thirds construction delivers it with a compass, no algebra on site).

**19.** Square beam: $w = d = \sqrt{450} \approx 21.2$ cm, stiffness $w^3 = 450^{3/2} \approx 9\,546$. Optimal beam: $S = 10\sqrt3 \times 600 = 6\,000\sqrt3 \approx 10\,392$. Gain: about $8.9\,\%$ stiffer from the same log — the [derivative](#def-g11-deriv-derivative) pays for the sawmill.

**20.** Geometry: the [tangent](#def-g11-deriv-tangent)’s equal angles turned a paraboloid into a light-gatherer. Numerics: sliding down [tangents](#def-g11-deriv-tangent) solves [equations](https://one-course.com/books/math/2/en/chapter/2-algebra-equations-and-inequalities#def-g10-algebra-equation) at digit-doubling speed. Optimization: a vanishing [derivative](#def-g11-deriv-derivative) found the log’s strongest rectangle. One object, three trades — and grade 12’s convexity will tell, in addition, on which side of every [tangent](#def-g11-deriv-tangent) the curve lies.
