See how polynomials approximate sin, cos, eˣ, ln(1+x) and more. Adjust expansion point and order to explore convergence radius and approximation error interactively.
Parameters
Function
Expansion point a
Order N
x Range
Display Options
Results
—
Approx. at x=a+0.5
—
Absolute Error
—
Relative Error
—
Radius of Conv.
Function vs Taylor Approximation (solid: exact, dashed: Taylor)
Taylor series underpins FEM shape functions (local polynomial approximation), Newton's method (tangent stiffness matrix = first-order Taylor linearization), and finite difference accuracy analysis. The small-angle approximation sin θ ≈ θ is Taylor's first term.
What is a Taylor Series?
🙋
What exactly is a Taylor series? It looks like we're trying to build a function out of polynomials.
🎓
Basically, yes! It's a way to approximate a complicated, curvy function near a specific point using a simple polynomial. The polynomial is built from the function's derivatives at that point. In this simulator, try setting the function to `sin(x)`, the expansion point `a` to 0, and slowly increase the Order `N`. You'll see the polynomial start to wrap around the sine wave.
🙋
Wait, really? So the "expansion point" is like the anchor? What happens if I move it away from zero?
🎓
Exactly! The point `a` is the anchor. The approximation is most accurate right there and gets worse as you move `x` away. For instance, if you set `a = π/2` for `sin(x)`, the series now builds a polynomial that perfectly knows `sin(π/2)=1`. Try it. You'll see the approximation is great near `π/2` but terrible near `x=0`, which is the opposite of the `a=0` case.
🙋
That makes sense. But how do I know if the approximation is "good enough"? The error seems to grow when I slide `x` to the edge of the range.
🎓
Great observation! The error is controlled by two things: the distance `|x-a|` and the order `N`. The simulator shows the error band. A common case is modeling a material's stress-strain curve. You'd pick `a` near the expected strain level. If your simulation might experience larger strains, you'd need a higher `N` or risk a "numerical blow-up" in your CAE solver.
Physical Model & Key Equations
The core idea is to reconstruct a function using its local behavior—its value and all its rates of change (derivatives)—at a single point `a`. The approximation is a sum of terms, each involving a higher-order derivative.
f(x): The function we want to approximate (e.g., `sin(x)`, `eˣ`). a: The expansion point (the "anchor"). N: The order of the polynomial (highest power used). f(n)(a): The n-th derivative of `f` evaluated at the point `a`.
The approximation is not perfect. The remainder or error term tells us exactly how much we're off by. It depends on the next derivative we didn't include, evaluated at some unknown point `ξ` between `a` and `x`.
RN(x): The error of the N-th order approximation. ξ: Some point between `a` and `x`. This is the Lagrange form of the remainder.
This equation shows why error grows with `|x-a|` (distance from anchor) and shrinks as `N` increases (we include more terms).
Real-World Applications
Nonlinear Equation Solving (Newton's Method): Newton's method is essentially using a 1st-order Taylor series to find where a function crosses zero. By approximating the complex function with a simple line (the tangent), we can quickly iterate toward a solution. This is fundamental in CAE solvers for nonlinear structural or thermal analysis.
Finite Element Method (FEM) Shape Functions: In advanced FEM for large deformations, the logarithmic (Hencky) strain uses a Taylor expansion of `ln(1+x)`. This allows accurate modeling of materials like rubber or metals under severe stretching, which is critical for simulating crash tests or manufacturing processes.
Material Creep and Relaxation Modeling: The time-dependent deformation of materials like plastics or metals at high temperature is often modeled with exponential decay functions. The Taylor series for `eˣ` provides a computationally efficient way to evaluate these functions inside a solver over millions of time steps.
Numerical Stability in Solvers: Understanding the "radius of convergence" of a series—how far from `a` it remains accurate—is vital. For example, using an expansion with too small a radius in a fluid dynamics simulation can lead to sudden, catastrophic numerical blow-up (solution divergence), causing the simulation to fail.
Common Misconceptions and Points to Note
While playing with this tool, you might encounter a few easy-to-misunderstand points. First, you might tend to think "increasing the degree makes it accurate everywhere," but that's a major misconception. Taylor expansion is inherently specialized for "the vicinity of the expansion point." For example, when expanding $\ln(1+x)$ at $a=0$, for $x > 1$ (e.g., $x=2$), no matter how many terms you add, the approximation will diverge and never catch up to the original function. This is the concept of the "radius of convergence." If you widen the $x$ range in the tool, you should see the graph go wild beyond a certain point. In practical work, using the approximation formula beyond this radius of convergence is an absolute no-go.
Next, the assumption that "the expansion point can always be zero." While $a=0$ (Maclaurin expansion) does simplify the expression, if the operating point you want to analyze is far from the origin, expanding around that point is far more efficient. For instance, if a pendulum oscillates always around $\theta \approx \pi/2$ (near horizontal), the first-order expansion of $\sin\theta$ at $a=\pi/2$ will be more accurate locally and simpler than a fifth-order expansion at $a=0$. When analyzing part deformation with CAE, the trick is to choose the center of the expected displacement as your expansion point.
Finally, don't assume "the error is symmetrical." The error $R_N(x)$ is proportional to $(x-a)^{N+1}$, so even at the same distance from the expansion point, the spread of the error becomes asymmetrical depending on the magnitude of the function's higher-order derivatives. Turn ON the "Error" graph display in the tool and compare $\sin(x)$ at $a=\pi/2$ with $e^x$ at $a=0$; the difference will be immediately clear. In actual design, you need to focus your evaluation on the direction where error is likely to be largest (e.g., the direction in which the material deforms the most).