📊 Section 1 — Interactive Simulation
Pick a function $f$ and an expansion point $a$. Slide the order $N$ — watch the Taylor polynomial $T_N(x) = \sum_{k=0}^N \frac{f^{(k)}(a)}{k!}(x-a)^k$ wrap tighter and tighter around $f$. The error region shows where the partial sum diverges from $f$.
Animation
Function Preset
Parameters
Display Options
Tips
• Press ▶ Play to grow $N$ — see how the polynomial wraps further.
• Try 1/(1−x) with $a=0$: it diverges at $x=1$ (radius = 1).
• Try e^(−1/x²): every Maclaurin coefficient is 0, so $T_N \equiv 0$ but $f \neq 0$ — Taylor series can fail to represent the function!
🪜 Section 2 — The Idea, Step by Step
From "guess the road ahead" all the way to the Lagrange remainder — one gentle climb, no jumps.
Glance at your speedometer while walking. Knowing where you are and how fast you're going right now, you can already guess where you'll be a second from now — without watching the whole road. Taylor's idea is exactly this: if you know everything about a curve at one single point — its height, its slope, how that slope is bending, and so on — you can rebuild the whole curve nearby using nothing fancier than a polynomial. The more local detail you feed in, the further out your guess stays trustworthy.
Try This in the Sim Above
1 · Watch it wrap. Pick $e^x$ and drag $N$ from $0$ upward — the orange polynomial hugs the blue curve over a wider and wider stretch.
2 · Hit the wall. Pick $1/(1-x)$ with $a=0$ and slide $x^*$ past $1$: the polynomial flies off no matter how large $N$ gets. You've crossed the radius of convergence $R=1$.
3 · See it fail. Pick $e^{-1/x^2}$: every coefficient is $0$, so $T_N$ stays pinned flat on the axis while the real function lifts away — a perfectly smooth function whose Taylor series refuses to rebuild it.
📐 Section 3 — Taylor's Theorem & Derivation
From the definition to the Lagrange remainder.
If $f$ has $N+1$ continuous derivatives near $a$, the Taylor polynomial of order $N$ at $a$ is $$T_N(x) \;=\; \sum_{k=0}^{N} \frac{f^{(k)}(a)}{k!}\,(x-a)^k = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(N)}(a)}{N!}(x-a)^N.$$ The Maclaurin series is the special case $a=0$. The Taylor series is the limit: $$f(x) \overset{?}{=} \sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}\,(x-a)^k.$$ Equality holds when the remainder $R_N(x) = f(x) - T_N(x) \to 0$ as $N\to\infty$.
If $f$ is $(N+1)$-times differentiable on the interval between $a$ and $x$, there exists $\xi$ strictly between $a$ and $x$ such that $$R_N(x) \;=\; f(x) - T_N(x) \;=\; \frac{f^{(N+1)}(\xi)}{(N+1)!}\,(x-a)^{N+1}.$$
In particular, if $\abs{f^{(N+1)}}\le M$ on $[a,x]$, then $\abs{R_N(x)} \le \dfrac{M}{(N+1)!}\abs{x-a}^{N+1}$ — the practical error bound.
Symbol Table
| Symbol | Meaning | Type |
|---|---|---|
| $f$ | Function being approximated | $(N+1)$-times differentiable near $a$ |
| $a$ | Expansion point — center of approximation | Real |
| $f^{(k)}(a)$ | $k$-th derivative of $f$ at $a$ | Real, $f^{(0)}=f$ |
| $T_N(x)$ | Taylor polynomial of order $N$ at $a$ | Polynomial in $x$, degree $\le N$ |
| $c_k$ | Taylor coefficient $f^{(k)}(a)/k!$ | Real |
| $R_N(x)$ | Remainder: $f(x) - T_N(x)$ | Real, $\to 0$ inside radius of convergence |
| $R$ | Radius of convergence | $R \in [0,\infty]$, distance to nearest singularity in $\C$ |
| $\xi$ | Mean-value point in Lagrange remainder | Strictly between $a$ and $x$ |
Derivation — Why $c_k = f^{(k)}(a)/k!$?
Simulation ↔ Symbol Mapping
slider N | order of the Taylor polynomial $T_N$ |
slider a | expansion point — series is centered at $a$ |
slider x* | probe — point at which to compare $f(x^*)$ vs $T_N(x^*)$ |
readout cₙ | $N$-th Taylor coefficient $f^{(N)}(a)/N!$ |
readout |f − Tₙ| | actual remainder magnitude at $x^*$ |
readout Lagrange bound | $M\abs{x^*-a}^{N+1}/(N+1)!$ where $M = \sup\abs{f^{(N+1)}}$ on $[a, x^*]$ |
graph Error vs N | $\log\abs{R_N(x^*)}$ vs $N$ — for entire functions, super-exponential decay |
graph radius | visualize convergence radius; outside it, $T_N(x)$ diverges as $N\to\infty$ |
Worked Example — Maclaurin Series of $\sin(x)$, $\cos(x)$, $e^x$
$e^x$ at $a=0$: all derivatives are $e^0 = 1$, so $c_k = 1/k!$. Thus $e^x = \sum_{k=0}^\infty \dfrac{x^k}{k!} = 1 + x + \dfrac{x^2}{2!} + \dfrac{x^3}{3!} + \cdots$. Radius $R = \infty$.
$\sin(x)$ at $a=0$: derivatives cycle $\sin\to\cos\to-\sin\to-\cos\to\sin\to\cdots$, so $f^{(k)}(0) = 0, 1, 0, -1, 0, 1, \ldots$. Result: $\sin x = \sum_{k=0}^\infty \dfrac{(-1)^k x^{2k+1}}{(2k+1)!} = x - \dfrac{x^3}{3!} + \dfrac{x^5}{5!} - \cdots$. $R = \infty$.
$\cos(x)$ at $a=0$: similarly, $\cos x = \sum_{k=0}^\infty \dfrac{(-1)^k x^{2k}}{(2k)!} = 1 - \dfrac{x^2}{2!} + \dfrac{x^4}{4!} - \cdots$. $R = \infty$.
Numerical check: $\sin(0.5)$ true value $0.479425539\ldots$. $T_5(0.5) = 0.5 - 0.5^3/6 + 0.5^5/120 = 0.5 - 0.020833\ldots + 0.000260\ldots = 0.479427\ldots$. Error $\approx 1.5\times 10^{-6}$ — Lagrange bound: $\abs{x}^7/7! = 0.5^7/5040 \approx 1.55\times 10^{-6}$. Matches!
Famous identity: Combine these to get $e^{ix} = \cos x + i \sin x$ (Euler) by checking series coefficients term-by-term. $\boxed{e^{i\pi} + 1 = 0.}$
❓ Section 4 — Frequently Asked Questions
A Taylor polynomial $T_N(x)$ is finite — a polynomial of degree $\leq N$. It always exists for any $N$ when $f$ is $N$-times differentiable, and it's an approximation: $f(x) = T_N(x) + R_N(x)$, with the remainder $R_N$ measurable but generally nonzero. The Taylor series is the infinite sum $\sum_{k=0}^\infty f^{(k)}(a)(x-a)^k/k!$ — it's a limit object that may or may not converge, and even if it converges, may not equal $f$ (see the bump-function example). So: polynomial = approximation tool with explicit error, series = formal infinite object that's only useful when it converges to $f$.
Key takeaway: Taylor polynomials always exist; Taylor series may diverge or converge to the wrong function.It animates how each new term $\dfrac{f^{(k)}(a)}{k!}(x-a)^k$ contributes to the partial sum. Mode shows $T_0 = f(a)$ (a horizontal line), then $T_1$ adds the tangent slope (linear approximation), $T_2$ adds the parabola correction, $T_3$ adds the cubic, and so on — each term highlights in a different color and its contribution is plotted alongside. You can clearly see the Taylor polynomial "wrap" further around $f$: $T_2$ matches function value + slope + curvature at $a$; $T_3$ matches up to the third derivative, and so on. By order $N$, $T_N$ matches all derivatives up to order $N$ at $a$ exactly.
Key takeaway: each term adds one more derivative-matched contribution at $a$; the polynomial gets better only near $a$.Almost everywhere a non-polynomial function meets a computer. CPUs compute $\sin, \cos, \exp, \log$ via low-order polynomial approximations (often Chebyshev-modified Taylor) — your hardware multiplies and adds, that's it. Physics: small-angle approximation $\sin\theta \approx \theta$ is $T_1$; pendulum equation linearization for SHM. Numerical methods: Newton's method's quadratic convergence comes from Taylor expansion. ODE solvers: Runge-Kutta methods are Taylor-series-matched at intermediate points. Machine learning: gradient descent uses $T_1$, Newton uses $T_2$ (the Hessian). Statistics: delta method approximates variance of $g(X)$ via $T_1$ around $\E[X]$. Quantum mechanics: time-evolution operator $e^{-iHt/\hbar}$ expanded in $t$.
Key takeaway: every computer's transcendental function is a Taylor-style polynomial; small-angle / linearization tricks in physics are $T_1$.The radius of convergence is determined by the nearest singularity in the complex plane, not just the real line. $1/(1-x)$ has a real singularity at $x=1$ — distance 1 from origin, so $R=1$. $1/(1+x^2)$ has no real singularities, but factoring over $\C$: $1+x^2 = (1+ix)(1-ix)$ — singularities at $x=\pm i$, complex distance from 0 is exactly 1. So the Maclaurin series $1 - x^2 + x^4 - x^6 + \cdots$ converges only for $\abs{x}<1$. This is Carl Friedrich Gauss's deep insight: Taylor series "see" complex singularities even when computed only with real values. This is why $1/(1+x^2)$ misbehaves at $x=\pm 1$ even though $f$ is smooth there.
Key takeaway: radius of convergence = distance to nearest complex singularity. Real-line smoothness isn't enough.Use the Lagrange bound: $\abs{R_N(x)} \le \dfrac{1}{(N+1)!}\abs{x}^{N+1}$ since $\abs{\sin^{(k)}}\le 1$. For $\sin(\pi/4)$: need $(\pi/4)^{N+1}/(N+1)! < \eps$. For $\eps = 10^{-6}$: $N=7$ suffices — and because $\sin$'s degree-8 term vanishes, $T_7 = T_8$, so the sharper bound is $(\pi/4)^9/9! \approx 3\times 10^{-7}$ (note $(\pi/4)^8/8! \approx 3.6\times 10^{-6}$ alone would not clear $10^{-6}$). For $\eps = 10^{-15}$ (machine precision): $N=15$. Practical CPUs use a smarter trick: range reduction (use $\sin(x+2\pi k) = \sin(x)$ to bring $x$ to $[-\pi/4, \pi/4]$), then a low-degree minimax polynomial — typically degree 7 or 11 — chosen by Remez algorithm to minimize maximum error rather than error at one point. So Taylor itself is rarely used in CPUs; its idea is.
Key takeaway: $N=7$ Taylor terms give $\sin$ to $10^{-6}$; CPUs use cleverer minimax polynomials of similar low degree.It's profound. In real analysis, "smooth" (infinitely differentiable) functions can have Taylor series that don't converge, or converge to the wrong function ($e^{-1/x^2}$ is smooth at 0 with all derivatives = 0, but is nonzero elsewhere). In complex analysis, the situation is much cleaner: a function holomorphic on a disk is automatically equal to its Taylor series there. This is Cauchy's integral theorem + Cauchy's formula: $f^{(n)}(a) = \dfrac{n!}{2\pi i}\oint \dfrac{f(z)}{(z-a)^{n+1}}\,dz$. The radius of convergence is exactly the distance to the nearest singularity in $\C$. Functions that equal their Taylor series everywhere are called analytic (or "real-analytic" on $\R$). Holomorphic ⇒ analytic in $\C$, but not in $\R$ — that's why complex analysis is so much "nicer".
Key takeaway: in $\C$, holomorphic = analytic, automatically. In $\R$, smooth ≠ analytic. Complex analysis is where Taylor really lives.Because of the $(x-a)^{N+1}$ factor in the remainder: $\abs{R_N(x)} \le M\abs{x-a}^{N+1}/(N+1)!$. When $\abs{x-a}$ is small, this is tiny — even for low $N$. When $\abs{x-a}$ is moderate, you need large $N$ to overcome the $(x-a)^{N+1}$ factor. When $\abs{x-a}$ exceeds the radius of convergence, no $N$ helps: the remainder grows. Geometrically: $T_N$ matches all derivatives at $a$, so it agrees with $f$ "infinitely closely" at $a$ — but it has no information about $f$'s behavior far from $a$. The polynomial extrapolates based purely on what it sees near $a$, which is only locally meaningful.
Key takeaway: $(x-a)^{N+1}$ factor makes Taylor a local tool; for global approximation use Chebyshev or Fourier.