Linear/Quadratic Approximation Cheatsheet

1. Definitions

1.1 Linear approximation

f(x)f(0)+f(0)xf(x) \approx f(0) + f'(0)\,x

Replace the curve with the straight line that matches it at x=0x=0 in height and slope.

1.1.1 Slope intuition

A line through (0,f(0))(0, f(0)) needs one more number: its slope. Pick the slope wrong and the line peels away from the curve immediately. Pick f(0)f'(0) and it stays glued for as long as possible.

Fixing the height at f(0) = 1, slide the slope b and watch the gap. Only one value hugs the curve.

average gap over [−1, 1]0.3452

1.1.2 Reconstructing a and b

The other way to read the formula: linear approximation is a search for the best a+bxa + bx.

Write P(x)=a+bxP(x) = a + bx and demand it agree with ff at 00:

P(0)=a a=f(0)P(0)=b b=f(0)\begin{aligned} P(0) &= a &&\Rightarrow\ a = f(0) \\ P'(0) &= b &&\Rightarrow\ b = f'(0) \end{aligned}

There is no choice left — matching height and slope forces both coefficients. So if you hand the formula something that already is a line, it must hand the same line back:

f(x)2 − 1x
f(0)2
f′(0)-1
f(0) + f′(0)·x2 − 1x

The last row always matches the first. Approximating something that is already a line hands the line straight back.

1.2 Quadratic approximation

f(x)f(0)+f(0)x+f(0)2x2f(x) \approx f(0) + f'(0)\,x + \frac{f''(0)}{2}x^2

Same idea, one more term: match the curve at x=0x=0 in height, slope, and curvature.

1.2.1 Parabola intuition

A line can only match height and slope; it is always straight while the curve bends. Adding an x2x^2 term lets the approximation bend too, and f(0)f''(0) says how much.

Fixing height and slope, slide the curvature coefficient c. Again, only one value fits.

average gap over [−1, 1]0.1770

1.2.2 Reconstructing a, b and c

Now the search is for the best a+bx+cx2a + bx + cx^2. Write P(x)=a+bx+cx2P(x) = a + bx + cx^2:

P(0)=a a=f(0)P(0)=b b=f(0)P(0)=2c c=12f(0)\begin{aligned} P(0) &= a &&\Rightarrow\ a = f(0) \\ P'(0) &= b &&\Rightarrow\ b = f'(0) \\ P''(0) &= 2c &&\Rightarrow\ c = \tfrac{1}{2}f''(0) \end{aligned}

That 12\tfrac{1}{2} is not a fudge factor — it is there because P(0)P''(0) comes out as 2c2c rather than cc.

g(x)2 − 1x + 0.5x²
g(0)2
g′(0)-1
g″(0)1
g(0) + g′(0)·x + g″(0)·x²/22 − 1x + 0.5x²

The last row always matches the first. Note g″(0) = 2c — the ÷2 in the formula is exactly what undoes that and recovers c.

Set c=0c=0 and the quadratic formula collapses into the linear one. Linear approximation is the quadratic with curvature switched off, which is why a function with f(0)=0f''(0)=0 has the same linear and quadratic approximation.

2. Cheatsheet

2.1 Near 0

Each entry lists f(0)f(0), f(0)f'(0) and f(0)f''(0), then both approximations, then the values against a direct calculation, then the graphs.

2.1.1 Trigonometric

2.1.1.1
linear
quadratic
xdirectlinearquadraticquad. error
00.0000000.0000000.0000000.000000
0.010.0100000.0100000.0100001.67e-7
0.10.0998330.1000000.1000000.000167
0.50.4794260.5000000.5000000.020574
10.8414711.0000001.0000000.158529
sin x

Odd function, so f″(0) = 0 and the quadratic term vanishes — the quadratic approximation is the linear one.

2.1.1.2
linear
quadratic
xdirectlinearquadraticquad. error
01.0000001.0000001.0000000.000000
0.010.9999501.0000000.9999504.17e-10
0.10.9950041.0000000.9950004.17e-6
0.50.8775831.0000000.8750000.002583
10.5403021.0000000.5000000.040302
cos x

Flat at 0, so the linear approximation is just the constant 1. All the information is in the quadratic term.

2.1.1.3
linear
quadratic
xdirectlinearquadraticquad. error
00.0000000.0000000.0000000.000000
0.010.0100000.0100000.0100003.33e-7
0.10.1003350.1000000.1000000.000335
0.50.5463020.5000000.5000000.046302
11.5574081.0000001.0000000.557408
tan x

Also odd, so again the quadratic term vanishes.

2.1.1.4
linear
quadratic
xdirectlinearquadraticquad. error
01.0000001.0000001.0000000.000000
0.011.0000501.0000001.0000502.08e-9
0.11.0050211.0000001.0050002.09e-5
0.51.1394941.0000001.1250000.014494
11.8508161.0000001.5000000.350816
sec x

The mirror of cos x — same flat linear part, opposite sign on the quadratic term.

2.1.1.5

No approximation at 0. cot x blows up there, so there is no finite value, slope, or curvature to match.

2.1.1.6

Same problem as cot x — undefined at 0, so no expansion exists there.

2.1.2 Exponents and logarithms

2.1.2.1
linear
quadratic
xdirectlinearquadraticquad. error
01.0000001.0000001.0000000.000000
0.011.0100501.0100001.0100501.67e-7
0.11.1051711.1000001.1050000.000171
0.51.6487211.5000001.6250000.023721
12.7182822.0000002.5000000.218282
e^x

Every derivative is e^x, so every coefficient at 0 is 1. This is the cleanest one to remember.

2.1.2.2
linear
quadratic
xdirectlinearquadraticquad. error
00.0000000.0000000.0000000.000000
0.010.0099500.0100000.0099503.31e-7
0.10.0953100.1000000.0950000.000310
0.50.4054650.5000000.3750000.030465
10.6931471.0000000.5000000.193147
ln(1 + x)

Written as ln(1 + x) rather than ln x precisely so that the expansion point sits at 0 — ln x has no expansion there.

2.1.2.3
linear
quadratic
r =
xdirectlinearquadraticquad. error
01.0000001.0000001.0000000.000000
0.011.0049881.0050001.0049876.21e-8
0.11.0488091.0500001.0487505.88e-5
0.51.2247451.2500001.2187500.005995
11.4142141.5000001.3750000.039214
(1 + x)^r

The workhorse. r = 1/2 gives √(1+x), r = −1 gives 1/(1+x). At r = 2 the quadratic approximation is exact — (1+x)² already is a quadratic, so there is nothing to discard.

2.1.2.4
linear
quadratic
a =
xdirectlinearquadraticquad. error
01.0000001.0000001.0000000.000000
0.011.0069561.0069311.0069555.56e-8
0.11.0717731.0693151.0717175.65e-5
0.51.4142141.3465741.4066300.007583
12.0000001.6931471.9333740.066626
a^x

Generalises e^x — set a = e and ln a = 1, recovering 1 + x + x²/2.

3. Combining approximations

Rather than differentiating a complicated function twice, build its approximation out of the entries above. The one move that covers most cases: substitute, then truncate.

operationrule
f+gf + gadd the approximations
kfk \cdot fscale the approximation by kk
fgf \cdot gmultiply the approximations, then truncate
fgf \circ g, where g(0)=0g(0) = 0substitute gg's approximation into ff's, then truncate

Truncate means: discard every power above the order you are working to — x2x^2 and up for linear, x3x^3 and up for quadratic.

For composition there is also the direct form, which is just the chain rule:

f(g(x))f(g(0))+f(g(0))g(0)xf(g(x)) \approx f(g(0)) + f'(g(0))\,g'(0)\,x

Two conditions worth keeping in mind:

  • The inside function must land near 0. Every entry above is an expansion around 00, so substitution is only legal when g(0)=0g(0) = 0.
  • Truncating is not optional. The product of two linear approximations contains an x2x^2 term that is not trustworthy — the inputs were only accurate to first order, so the second-order information in the product is noise.

That second point is worth seeing. Multiplying two linear approximations gives

(f(0)+f(0)x)(g(0)+g(0)x)=f(0)g(0)+[f(0)g(0)+f(0)g(0)]x+f(0)g(0)x2\big(f(0) + f'(0)x\big)\big(g(0) + g'(0)x\big) = f(0)g(0) + \big[f'(0)g(0) + f(0)g'(0)\big]x + f'(0)g'(0)x^2

Drop the x2x^2 and the coefficient of xx is f(0)g(0)+f(0)g(0)f'(0)g(0) + f(0)g'(0) — exactly (fg)(0)(fg)'(0) from the product rule. The shortcut agrees with the definition, which is why it is safe.