standarddeviationcalculator.net

Updated Free · runs in your browser

Linear approximation calculator

--- --- Methodology

A linear approximation replaces a curve by its tangent line near one point. Enter a function, the point a and the x you want to estimate: the calculator gives f(a), f′(a), the linearization L(x), the approximation at x and how far it is from the exact value.

Use + − × ÷ and ^ for powers; sqrt, sin, cos, tan, ln, exp and brackets work. Angles are in radians.

Constants such as 2, -1/3, pi/4 are fine.

Leave blank to get only L(x).

L(4.1) ≈ f(4.1) 2.025
f(a)2
f′(x)1/(2√x)
f′(a)0.25
L(x) = f(a) + f′(a)(x − a)L(x) = 0.25x + 1
Central-difference check of f′(a)0.25 (step h = 10⁻⁶)
L(4.1)2.025
True f(4.1)2.0248457
Error L(x) − f(x)0.0001543
Relative error0.007622%
Show the working, step by step
  1. Evaluate the function at the point.

    f(4) = 2

  2. Differentiate and evaluate the slope at a.

    f′(x) = 1/(2√x) f′(4) = 0.25

  3. Build the linearization (the tangent line at a).

    L(x) = 2 + 0.25(x − 4) L(x) = 0.25x + 1

  4. Plug x into L.

    L(4.1) = 2 + 0.25 × (0.1) = 2.025

  5. Compare with the exact value.

    f(4.1) = 2.0248457 error = L(x) − f(x) = 0.0001543

The derivative is symbolic; the central difference (f(a + h) − f(a − h)) ÷ 2h with h = 10⁻⁶ is only a cross-check. A linearization is accurate only close to a, and the error grows roughly with (x − a)².

The linearization formula

L(x) = f(a) + f′(a)(x − a)

Near x = a a differentiable function looks almost like a straight line. That line passes through the point (a, f(a)) and has the slope f′(a), so its point-slope equation is the formula above. Use L(x) instead of f(x) when f(x) is hard to compute by hand but f(a) and f′(a) are easy, as with a square root near a perfect square.

The derivative here is found symbolically and then evaluated at a. As a check the calculator also shows the central difference (f(a + h) − f(a − h)) ÷ 2h with the stated step h = 10⁻⁶; the two should agree to six or more digits. For the rules behind f′(x), see the derivative calculator.

Worked example: √4.1

The calculator starts with f(x) = √x, a = 4 and x = 4.1.

  1. f(4) = √4 = 2.
  2. f′(x) = 1/(2√x), so f′(4) = 1/4 = 0.25.
  3. L(x) = 2 + 0.25(x − 4) = 0.25x + 1.
  4. L(4.1) = 2 + 0.25 × 0.1 = 2.025.
  5. The exact value is √4.1 = 2.0248457, so the error L(x) − f(x) is 0.0001543, a relative error of 0.007622%.

Two more examples, and what the error tells you

f(x)aL(x)xL(x)f(x)L − f
ln(x)1x − 11.10.10.09531020.00469
eˣ01 + x0.21.21.2214028−0.0214

The sign of the error follows the curvature. ln x and √x bend downwards, so their tangent lines sit above them and L(x) is a little too big. eˣ bends upwards, so its tangent line sits below it and L(x) is too small. The error also grows roughly like (x − a)²: moving ten times further from a makes it about a hundred times larger.

Common mistakes

  • Using degrees. The derivatives of sin and cos are only cos and −sin when x is in radians. Convert first, and enter a as pi/6 rather than 30.
  • Choosing a point where f(a) is hard. Pick the nearest a where f(a) and f′(a) are exact, such as 4 for √4.1 or 27 for the cube root of 27.5.
  • Forgetting (x − a). The slope multiplies the distance from a, not x itself.
  • Going too far from a. The estimate is only reliable close to a. Check the error.
  • Applying it at a corner. |x| at 0 has no tangent line, so there is no linearization.

To see the tangent line as an ordinary line, with its slope, angle and intercept, put its slope into the slope calculator. To follow where the derivative comes from, see the limit calculator.

Linear approximation calculator: the worked example on this page, with its result and chart
Linear approximation calculator: the worked example above, at a glance.

Common questions

What is the linear approximation formula?

L(x) = f(a) + f′(a)(x − a). It is the equation of the tangent line to y = f(x) at x = a, and for x close to a it gives a good estimate of f(x). The value f(a) is where the line starts and f′(a) is its slope.

What is the difference between linearization and linear approximation?

The same idea. The linearization of f at a is the function L(x) = f(a) + f′(a)(x − a). A linear approximation is using L(x) as an estimate of f(x) near a. Some books also call it the tangent line approximation.

How do you use linear approximation to estimate √4.1?

Take f(x) = √x at a = 4, where the root is exact. f(4) = 2 and f′(x) = 1/(2√x), so f′(4) = 1/4. Then L(4.1) = 2 + 0.25 × 0.1 = 2.025. The true value is 2.0248457, so the error is about 0.00015.

Is the linear approximation an overestimate or an underestimate?

It depends on the curvature. If f is concave down near a (f″ < 0, like √x or ln x) the tangent line lies above the graph and L(x) overestimates. If f is concave up (f″ > 0, like eˣ) the tangent line lies below the graph and L(x) underestimates. The calculator shows the signed error L(x) − f(x), so you can see which.

Does the calculator take the derivative symbolically?

Yes. The derivative is found symbolically and then evaluated at a. As an independent check it also shows a central difference, (f(a + h) − f(a − h)) ÷ 2h with h = 10⁻⁶. If the function is undefined at a, or has a corner or vertical tangent there (such as |x| at 0 or √x at 0), the calculator says so instead of giving a number. Trigonometric functions use radians.