21. Differentials · Newton's Method
Adapted from: Classical single-variable calculus (linear approximation and Newton root-finding). Rewritten for teaching — not a verbatim textbook dump.
If f f f is differentiable at x x x , then
f ′ ( x ) = lim Δ x → 0 Δ y Δ x , Δ y = f ( x + Δ x ) − f ( x ) . f'(x)=\lim_{\Delta x\to 0}\frac{\Delta y}{\Delta x},\qquad \Delta y=f(x+\Delta x)-f(x). f ′ ( x ) = Δ x → 0 lim Δ x Δ y , Δ y = f ( x + Δ x ) − f ( x ) .
So for small Δ x \Delta x Δ x ,
Δ y Δ x ∼ f ′ ( x ) ⇒ Δ y ∼ f ′ ( x ) Δ x . (21.1) \frac{\Delta y}{\Delta x}\sim f'(x)
\quad\Rightarrow\quad
\Delta y\sim f'(x)\,\Delta x. \tag{21.1} Δ x Δ y ∼ f ′ ( x ) ⇒ Δ y ∼ f ′ ( x ) Δ x . ( 21.1 )
Rearranged:
f ( x + Δ x ) ∼ f ( x ) + f ′ ( x ) Δ x . (21.2) f(x+\Delta x)\sim f(x)+f'(x)\,\Delta x. \tag{21.2} f ( x + Δ x ) ∼ f ( x ) + f ′ ( x ) Δ x . ( 21.2 )
This is the linear (or tangent-line) approximation to f f f near x x x .
Formula (21.2) does not by itself say how small Δ x \Delta x Δ x must be for a chosen number of correct decimals. That needs remainder estimates (later: Taylor with remainder).
Example 21.1 — Estimate 16.2 \sqrt{16.2} 16.2
Take f ( x ) = x f(x)=\sqrt{x} f ( x ) = x , x = 16 x=16 x = 16 , Δ x = 0.2 \Delta x=0.2 Δ x = 0.2 . Then f ( 16 ) = 4 f(16)=4 f ( 16 ) = 4 and
f ′ ( x ) = 1 2 x ⟹ f ′ ( 16 ) = 1 8 . f'(x)=\frac{1}{2\sqrt{x}}\implies f'(16)=\frac18. f ′ ( x ) = 2 x 1 ⟹ f ′ ( 16 ) = 8 1 .
So
16.2 ∼ 4 + 1 8 ( 0.2 ) = 4.025. \sqrt{16.2}\sim 4+\frac18(0.2)=4.025. 16.2 ∼ 4 + 8 1 ( 0.2 ) = 4.025.
(True value ≈ 4.0249 \approx 4.0249 ≈ 4.0249 — three decimals agree.)
Example 21.2 — Estimate sin ( 0.1 ) \sin(0.1) sin ( 0.1 )
Take f ( x ) = sin x f(x)=\sin x f ( x ) = sin x , x = 0 x=0 x = 0 , Δ x = 0.1 \Delta x=0.1 Δ x = 0.1 . Then f ( 0 ) = 0 f(0)=0 f ( 0 ) = 0 , f ′ ( 0 ) = cos 0 = 1 f'(0)=\cos 0=1 f ′ ( 0 ) = cos 0 = 1 , so
sin ( 0.1 ) ∼ 0.1. \sin(0.1)\sim 0.1. sin ( 0.1 ) ∼ 0.1.
True value ≈ 0.0998 \approx 0.0998 ≈ 0.0998 . Same idea: sin u ∼ u \sin u\sim u sin u ∼ u for small u u u .
Check: linear approx
Formula (21.2) says f(x+Δx) is approximately…
A f(x)/Δx B f(x) + f′(x) Δx C f(x+Δx) − f(x) D f′(x)
Pick an answer to see if you are right.
The differential
The product on the right of (21.1) is the differential of f f f :
d f = f ′ ( x ) Δ x . df = f'(x)\,\Delta x. df = f ′ ( x ) Δ x .
It depends on both x x x and Δ x \Delta x Δ x . For small Δ x \Delta x Δ x ,
f ( x + Δ x ) − f ( x ) ∼ d f . (21.3) f(x+\Delta x)-f(x)\sim df. \tag{21.3} f ( x + Δ x ) − f ( x ) ∼ df . ( 21.3 )
Fig. 21-1 — RT = df approximates RQ = Δy
In the figure, the tangent L \mathscr{L} L at P P P has slope f ′ ( x ) f'(x) f ′ ( x ) , so the vertical rise over Δ x \Delta x Δ x is d f df df . The true change along the curve is Δ y \Delta y Δ y ; they nearly match when Δ x \Delta x Δ x is small.
Writing d x dx d x
If f ( x ) = x f(x)=x f ( x ) = x , then d x = Δ x dx=\Delta x d x = Δ x . Hence we may rewrite
d f = f ′ ( x ) d x , df = f'(x)\,dx, df = f ′ ( x ) d x ,
and when Δ x ≠ 0 \Delta x\neq 0 Δ x = 0 ,
d f d x = f ′ ( x ) . \frac{df}{dx}=f'(x). d x df = f ′ ( x ) .
With y = f ( x ) y=f(x) y = f ( x ) one writes d y dy d y for d f df df — the familiar d y / d x dy/dx d y / d x .
Algebra of differentials
For functions u , v u,v u , v and constant c c c :
d ( c ) = 0 , d ( c u ) = c d u , d ( u + v ) = d u + d v , d ( u v ) = u d v + v d u , d ( u v ) = v d u − u d v v 2 . \begin{aligned}
d(c)&=0,&
d(cu)&=c\,du,&
d(u+v)&=du+dv,\\
d(uv)&=u\,dv+v\,du,&
d\!\left(\frac{u}{v}\right)&=\frac{v\,du-u\,dv}{v^{2}}.
\end{aligned} d ( c ) d ( uv ) = 0 , = u d v + v d u , d ( c u ) d ( v u ) = c d u , = v 2 v d u − u d v . d ( u + v ) = d u + d v ,
Examples: d ( tan x ) = sec 2 x Δ x d(\tan x)=\sec^{2}x\,\Delta x d ( tan x ) = sec 2 x Δ x , and d ( x 3 − 2 x ) = ( 3 x 2 − 2 ) Δ x d(x^{3}-2x)=(3x^{2}-2)\,\Delta x d ( x 3 − 2 x ) = ( 3 x 2 − 2 ) Δ x .
Newton's method
Suppose x 0 x_0 x 0 is near a root of f ( x ) = 0 f(x)=0 f ( x ) = 0 and f f f is differentiable. The tangent at x 0 x_0 x 0 usually hits the x x x -axis at a better guess x 1 x_1 x 1 .
Fig. 21-2 — tangent at x₀ meets the axis at x₁
Point-slope for the tangent:
y − f ( x 0 ) = f ′ ( x 0 ) ( x − x 0 ) . y-f(x_0)=f'(x_0)(x-x_0). y − f ( x 0 ) = f ′ ( x 0 ) ( x − x 0 ) .
At the intercept ( x 1 , 0 ) (x_1,0) ( x 1 , 0 ) , if f ′ ( x 0 ) ≠ 0 f'(x_0)\neq 0 f ′ ( x 0 ) = 0 ,
x 1 = x 0 − f ( x 0 ) f ′ ( x 0 ) . x_1=x_0-\frac{f(x_0)}{f'(x_0)}. x 1 = x 0 − f ′ ( x 0 ) f ( x 0 ) .
Repeating from x 1 , x 2 , … x_1,x_2,\ldots x 1 , x 2 , … gives
x n + 1 = x n − f ( x n ) f ′ ( x n ) . (21.5) x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}. \tag{21.5} x n + 1 = x n − f ′ ( x n ) f ( x n ) . ( 21.5 )
If f ′ ( x n ) ≈ 0 f'(x_n)\approx 0 f ′ ( x n ) ≈ 0 , or the seed is far from a simple root, the sequence can diverge, cycle, or jump to another root. Always plot or sanity-check the start.
Example 21.3 — Approximate 3 \sqrt{3} 3
Solve f ( x ) = x 2 − 3 = 0 f(x)=x^{2}-3=0 f ( x ) = x 2 − 3 = 0 . Then f ′ ( x ) = 2 x f'(x)=2x f ′ ( x ) = 2 x and (21.5) becomes
x n + 1 = x n 2 + 3 2 x n . (21.6) x_{n+1}=\frac{x_n^{2}+3}{2x_n}. \tag{21.6} x n + 1 = 2 x n x n 2 + 3 . ( 21.6 )
With x 0 = 1 x_0=1 x 0 = 1 :
n n n x n x_n x n (approx.)0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 1.75 1.75 1.75 3 3 3 1.732142857 1.732142857 1.732142857 4 4 4 1.73205081 1.73205081 1.73205081 5 5 5 –6 6 6 1.732050808 1.732050808 1.732050808 (stable)
So 3 ≈ 1.732050808 \sqrt{3}\approx 1.732050808 3 ≈ 1.732050808 to the digits shown.
Check: Newton
A xₙ₊₁ = f(xₙ)/f′(xₙ) B xₙ₊₁ = f′(xₙ) C xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ) D xₙ₊₁ = xₙ + f′(xₙ)
Pick an answer to see if you are right.
Takeaways
Δ y ∼ f ′ ( x ) Δ x \Delta y\sim f'(x)\,\Delta x Δ y ∼ f ′ ( x ) Δ x and f ( x + Δ x ) ∼ f ( x ) + f ′ ( x ) Δ x f(x+\Delta x)\sim f(x)+f'(x)\,\Delta x f ( x + Δ x ) ∼ f ( x ) + f ′ ( x ) Δ x
d f = f ′ ( x ) d x df=f'(x)\,dx df = f ′ ( x ) d x ; algebra mirrors derivative rules
Newton: x n + 1 = x n − f ( x n ) / f ′ ( x n ) x_{n+1}=x_n-f(x_n)/f'(x_n) x n + 1 = x n − f ( x n ) / f ′ ( x n ) — fast near a simple root, not magic from a bad start
Further Reading