Linearization is a first-order Taylor approximation of a function near an expansion point x0. It replaces a nonlinear function with a local line whose slope matches the derivative at x0.
This calculator estimates the derivative numerically using the central difference formula, which is accurate for small step size h:
- Enter your function f(x) using allowed operators and functions.
- Choose the expansion point x0 where the line should match the curve.
- Set the evaluation value x to compare f(x) and L(x).
- Adjust step size h if the slope looks noisy or unstable.
- Export the sample table using CSV or PDF buttons after calculating.
Example inputs: f(x)=sin(x)+0.25x^2, x0=0.8, h=1e−5, range 0.4 to 1.2.
| x | f(x) | L(x) | abs error | rel error |
|---|---|---|---|---|
| 0.4 | 0.4594 | 0.4923 | 0.0329 | 0.0716 |
| 0.6 | 0.6442 | 0.6503 | 0.0061 | 0.0095 |
| 0.8 | 0.8374 | 0.8374 | 0.0000 | 0.0000 |
| 1.0 | 1.0343 | 1.0541 | 0.0198 | 0.0191 |
| 1.2 | 1.2301 | 1.3006 | 0.0705 | 0.0573 |
1) Why linearization matters in physics
Many physical laws are nonlinear, yet experiments often probe small deviations around an operating point. Linearization replaces a curve with a locally valid line, enabling quick predictions, stability checks, and clear sensitivity estimates. It is the first step behind linear response methods, small‑signal models, and perturbation analysis.
2) The first‑order Taylor idea
The calculator builds the approximation L(x)=f(x0)+f′(x0)(x−x0). The term f(x0) sets the intercept at the expansion point, while f′(x0) sets the slope. Accuracy improves as x moves closer to x0.
3) Numerical derivative with central difference
When an analytic derivative is inconvenient, the tool estimates it using [f(x0+h)−f(x0−h)]/(2h). This method has truncation error proportional to h² for smooth functions, making it more accurate than forward difference for the same step size.
4) Choosing a practical step size h
If h is too large, truncation dominates and the slope is biased. If h is too small, rounding and cancellation can amplify noise. A common starting point is h=1e−5 to 1e−6 for well‑scaled functions, then adjust until the slope stabilizes.
5) Interpreting absolute and relative error
Absolute error measures |f(x)−L(x)|, while relative error divides by |f(x)|. Relative error can become large or undefined when f(x) is near zero; in that case, rely on absolute error and consider rescaling the model.
6) Reading the sample table over a range
The range table evaluates multiple points between your chosen minimum and maximum. This reveals where the linear model stays faithful and where curvature causes divergence. Increasing the number of points (for example 25 to 100) provides a finer error profile for reporting or debugging a model.
7) Typical physics use cases
Linearization supports small‑angle and small‑oscillation models, such as approximating sin(θ) near zero, linearizing an equation of state near a working temperature, or simplifying a nonlinear sensor transfer curve around a calibration point. It is also used when analyzing equilibrium and stability near fixed points.
8) What to report from this calculator
For professional notes, report the function, the chosen x0, the estimated slope f′(x0), the numeric linear form, and an error summary at one or more evaluation points. Export the table to CSV for spreadsheets or PDF for quick sharing in lab logs and technical write‑ups.
1) What does the calculator compute?
It builds a first‑order linear approximation around x0, then compares the approximation to the original function at your selected x, including absolute and relative error.
2) Which functions and constants are supported?
You can use x, pi, e, parentheses, powers, and common functions such as sin, cos, tan, exp, ln, log, sqrt, and abs.
3) Why is my relative error shown as NaN?
Relative error divides by |f(x)|. If f(x) is extremely close to zero, the ratio is not meaningful. Use absolute error or evaluate at a nearby point.
4) How should I choose the expansion point x0?
Pick x0 near the operating region of interest, such as a measured equilibrium or a calibration point. The linear approximation is most accurate close to x0.
5) How do I tune h for the derivative?
Start with h around 1e−5 to 1e−6 for typical scales. If slopes fluctuate, increase h slightly; if slopes look biased, reduce h cautiously.
6) Why does the table show growing error away from x0?
Linearization ignores curvature. As x moves farther from x0, higher‑order terms matter more, so the approximation deviates and error naturally increases.
7) Can I use this for piecewise or non‑smooth functions?
You can, but derivatives near kinks or discontinuities may be unstable. Choose x0 in a smooth region and interpret the slope and error with extra caution.