# What is the linear approximation of f?

Finds the linearization L(x) of f at x = a and uses it to estimate f at a nearby x, checked numerically.

- Page: https://www.acalculator.org/math/linear-approximation-calculator
- JSON spec: https://www.acalculator.org/math/linear-approximation-calculator.json
- Version: ae22cff4dee9

## Default answer

Example with the default inputs (Function f(x) sqrt(x), Centre a 9, Estimate f at x = (optional) 9.1): The linear approximation of sqrt(x) at x = 9 is L(x) = x/6 + 3/2.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| f | Function f(x) | The function to approximate, typed like sqrt(x), sin(x) or x^3. |
| a | Centre a | The point where L(x) touches f: a number or a constant such as pi/3. |
| x | Estimate f at x = (optional) | A value of x near a where L(x) estimates f(x). |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| line | L(x) = | The linear approximation L(x) = f(a) + f′(a)(x − a), expanded, with exact numbers. |
| estimate | Estimate L(x) | L at the chosen x. |
| actual | Exact f(x) | f at the chosen x, to compare. |

## Method

L(x) = f(a) + f′(a)(x − a). A computer algebra system finds f′(a); it is shown only when f′ matches a difference quotient at 20 points and at a.

## Assumptions

- The variable is x; angles are in radians; ln is the natural logarithm.
- An answer that fails its check is not shown.

## Worked examples

1. f = sqrt(x), a = 9, x = 9.1 gives line = x/6 + 3/2, estimate = 3.016667, actual = 3.016621. Source: OpenStax, Calculus Volume 1, section 4.2 Linear Approximations and Differentials, Example 4.5. https://openstax.org/books/calculus-volume-1/pages/4-2-linear-approximations-and-differentials.
2. f = sin(x), a = pi/3, x = 31pi/90 gives line = sqrt(3)/2 - π/6 + x/2, estimate = 0.883479, actual = 0.882948.

## FAQ

### What is a linear approximation?

The linear approximation, or linearization, of f at x = a is L(x) = f(a) + f′(a)(x − a): the tangent line at a, used in place of the curve. For x close to a, f(x) ≈ L(x), and L is much easier to work out than f.

### How do I estimate √9.1 with a linear approximation?

Take f(x) = √x and a = 9, where √9 = 3 is easy. f′(x) = 1/(2√x), so f′(9) = 1/6. Then L(x) = 3 + (x − 9)/6 and √9.1 ≈ L(9.1) = 3 + 0.1/6 = 3.0166667. The true value is 3.0166206, so the estimate is off by about 0.00005.

### How accurate is the estimate?

It is best close to a and gets worse further away. For a function with a second derivative, the error f(x) − L(x) is about f″(a)(x − a)²/2, so halving the distance to a cuts the error to about a quarter. The page shows f(x) beside L(x) so you can see the error.

### What is the difference between a linear approximation and a differential?

They are the same idea. The differential dy = f′(a) dx is the change in L when x changes by dx, while the true change is Δy = f(a + dx) − f(a). So f(a + dx) ≈ f(a) + dy = L(a + dx).

### Why is the estimate not shown for some x?

The estimate L(x) is shown for any number you type, but the exact value f(x) is left out where f is not a real number, such as √x for x below 0, and where rounding x to a computer number could change its 10th figure, such as ln(x) at 1.0000000005. The line L(x) itself needs f to have a derivative at a.

### How is the answer checked?

The line comes from a computer algebra system; each derivative it uses is compared with a numeric difference quotient at 20 points, and the slope with the slope of f just left and right of a. If a check fails the page says "No verified answer".

## Sources

- OpenStax, Calculus Volume 1, section 4.2 Linear Approximations and Differentials: https://openstax.org/books/calculus-volume-1/pages/4-2-linear-approximations-and-differentials
