📊 Section 1 — Interactive Simulation
Controls
Function
Display
🪜 Section 2 — The Idea, Step by Step
Your phone has no secret "sine gear" spinning inside it. Deep down, a chip can really only add and multiply — so how does it ever show you $\sin(0.5)$ or $e^x$? It cheats with a polynomial: a plain sum of powers of $x$, tuned to hug the real curve right around one chosen point. Get the height right there, then the slope, then how that slope bends, and the polynomial clings to the true graph more and more tightly. That clinging is the whole idea of a Taylor series.
The point you build around is the center $a$. When $a=0$ we give it a special name — a Maclaurin series. The crudest guess is a flat line at the curve's height, $T_0(x)=f(a)$. Add the slope and you get the tangent line, $T_1(x)=f(a)+f'(a)(x-a)$. Each new piece comes from one more derivative, divided by a factorial: the coefficient of $(x-a)^k$ is $f^{(k)}(a)/k!$, so $T_n(x)=\sum_{k=0}^{n}\dfrac{f^{(k)}(a)}{k!}(x-a)^k$. Worked number: for $e^x$ at $a=0$ every derivative at $0$ is $1$, so $T_2(x)=1+x+\tfrac{x^2}{2}$. At $x=0.5$ that gives $1+0.5+0.125=1.625$, while the true $e^{0.5}=1.6487\ldots$ — already within about $1.5\%$. Add the $x^3/6$ term and you land on $1.6458$, closer still.
How wrong you can be is pinned down by the Lagrange remainder $R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$ for some $c$ between $a$ and $x$. That fast-growing factorial in the denominator is the hero: for $e^x$, $\sin x$, and $\cos x$ it crushes the powers so completely that the series converges for every $x$. But for $\ln(1+x)$ or $\tfrac{1}{1-x}$ there is a wall — the radius of convergence $R=1$: inside $|x-a|
1 · Watch it wrap. Pick $e^x$ and drag Terms $n$ upward — the partial-sum curves hug the gold curve over a wider and wider stretch while $|$Error$|$ drops fast. 2 · Hit the wall. Pick $1/(1-x)$, set Evaluate at $x$ near $1$, and crank $n$: the approximation refuses to settle — you have reached the radius $R=1$. 3 · Few terms, big payoff. Switch to $\sin(x)$ and compare how few terms nail the curve near $x=0$ against how many you need out near $x=\pm3$ — far from the center always costs more terms.
📐 Section 3 — Taylor Series: Theorem & Convergence
If $f$ is $(n+1)$ times differentiable on an interval containing $a$ and $x$, then:
$$f(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k + R_n(x), \quad R_n(x)=\frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$$for some $c$ between $a$ and $x$. The series converges to $f(x)$ iff $R_n(x)\to0$.
| Series | Maclaurin expansion | Radius $R$ |
|---|---|---|
| $e^x$ | $\displaystyle\sum_{n=0}^\infty \frac{x^n}{n!}$ | $\infty$ |
| $\sin x$ | $\displaystyle\sum_{n=0}^\infty \frac{(-1)^n x^{2n+1}}{(2n+1)!}$ | $\infty$ |
| $\cos x$ | $\displaystyle\sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{(2n)!}$ | $\infty$ |
| $\ln(1+x)$ | $\displaystyle\sum_{n=1}^\infty \frac{(-1)^{n+1}x^n}{n}$ | $1$ (conv. on $(-1,1]$) |
| $\frac{1}{1-x}$ | $\displaystyle\sum_{n=0}^\infty x^n$ | $1$ (strict) |
If $f(x)=\sum_{k=0}^\infty c_k(x-a)^k$, differentiate $k$ times and evaluate at $x=a$: $f^{(k)}(a)=k!\,c_k$, so $c_k=f^{(k)}(a)/k!$. The Taylor series is uniquely determined by all derivatives at $a$.
$R=\lim_{n\to\infty}|c_n/c_{n+1}|$. For $e^x$: $c_n=1/n!$, so $R=\lim(1/n!)/(1/(n+1)!)=\lim(n+1)=\infty$. For $\ln(1+x)$: $c_n=(-1)^{n+1}/n$, so $R=\lim n/(n+1)=1$. The radius equals the distance to the nearest singularity in $\mathbb{C}$.
For alternating series $\sum(-1)^n b_n$ with $b_n\searrow0$: $|L-S_n|\leq b_{n+1}$ (first omitted term). For $\sin(0.5)$ with 3 terms: error $\leq 0.5^7/7!\approx1.6\times10^{-6}$.
$|R_n(x)|=|e^c|/((n+1)!)|x|^{n+1}\leq e^{|x|}|x|^{n+1}/(n+1)!\to0$ as $n\to\infty$ for any fixed $x$, since $x^n/n!\to0$ for all $x$ (factorial growth beats exponential). So $e^x=\sum x^n/n!$ for all $x\in\mathbb{R}$.
Apply the Maclaurin series to $e^{ix}$: $e^{ix}=\sum(ix)^n/n!=\cos x+i\sin x$. This is Euler's formula, connecting the five most important constants: $e^{i\pi}+1=0$.
$\cos(0.1)=1-0.01/2+0.0001/24-\cdots$ Error after $n$ terms (alternating): $\leq(0.1)^{2n+2}/(2n+2)!$. For $n=2$: $\leq(0.1)^6/720\approx1.4\times10^{-9}$ — about 8 correct digits from just 3 non-zero terms ($1-0.005+0.0000042$). Adding the $n=3$ term ($\leq(0.1)^8/8!\approx2.5\times10^{-13}$) carries you well past 10-digit accuracy ✓.
❓ Section 4 — FAQ
No. The function $f(x)=e^{-1/x^2}$ (with $f(0)=0$) has $f^{(n)}(0)=0$ for all $n$, so its Maclaurin series is identically 0 — yet $f(x)\neq0$ for $x\neq0$. Such functions are smooth but not analytic. A function equals its Taylor series only when the remainder $R_n(x)\to0$. This requires more than just smoothness.
Key takeaway: smooth ≠ analytic. $e^{-1/x^2}$ is $C^\infty$ but its Taylor series is 0 everywhere — they disagree everywhere except $x=0$.Each "Add Terms" press adds one more term to $T_n(x)$. The gold curve is the exact function; purple curves of increasing brightness show $T_1, T_2,\ldots,T_n$. Within the radius of convergence the curves converge to gold. Outside the radius they diverge — most dramatically for $1/(1-x)$ near $|x|=1$. The error graph (bottom) shows $|T_n(x)-f(x)|$ decreasing geometrically on a log scale.
Key takeaway: inside the radius each term helps; outside, adding terms makes things worse — watch the curves diverge.Hardware: CPUs compute $e^x$, $\sin x$, $\cos x$ using truncated Taylor or Chebyshev polynomial approximations — a few dozen operations give full double-precision accuracy. Physics: small-angle $\sin\theta\approx\theta$ (pendulum, optics), relativistic $\gamma\approx1+v^2/(2c^2)$. Error propagation in measurements (first-order Taylor). Numerical ODEs: Taylor series method. Quantum mechanics: perturbation theory expands the Hamiltonian in powers of a small parameter.
Key takeaway: CPU math functions, small-angle approximations, perturbation theory, error propagation — all Taylor series in disguise.The radius of convergence equals the distance to the nearest singularity in the complex plane $\mathbb{C}$. $e^z$ has no singularities anywhere, so $R=\infty$. $\ln(1+z)$ has a branch point singularity at $z=-1$, which is distance 1 from the expansion point $z=0$, giving $R=1$. Even though the real function $\ln(1+x)$ looks smooth for $x>-1$, the complex singularity at $z=-1$ limits convergence on the real line too.
Key takeaway: complex singularities control real convergence. $\ln(1+z)$ has a branch cut at $z=-1$, distance 1 from origin → $R=1$.Alternating series error bound: $|R_n|\leq\pi^{2n+3}/(2n+3)!$. Testing $n=10$ ($T_{21}$): $\pi^{23}/23!\approx1.1\times10^{-11}<10^{-10}$ ✓, while $n=9$ ($T_{19}$) gives $\pi^{21}/21!\approx5.5\times10^{-10}$ — not quite enough. So 11 non-zero terms (degree-21 polynomial) suffice. Check: factorial $23!\approx2.6\times10^{22}$ completely dominates $\pi^{23}\approx2.7\times10^{11}$. At $x=100$: well over a hundred terms — and catastrophic cancellation makes direct summation impractical, so real libraries first reduce $x$ modulo $2\pi$.
Key takeaway: about 11 terms give 10 digits of $\sin(\pi)$ — factorials in the denominator eventually outrun the powers in the numerator.In complex analysis, a function is analytic (holomorphic) if and only if it equals its Taylor series locally. The Cauchy integral formula gives: $f^{(n)}(a)/n!=\frac{1}{2\pi i}\oint_C f(z)/(z-a)^{n+1}dz$, so the Taylor coefficients are contour integrals. The radius of convergence equals the distance to the nearest singularity (pole, branch point) in $\mathbb{C}$. This is why real Taylor series convergence is governed by complex analysis — even when the function looks perfectly smooth on the real line.
Key takeaway: in $\mathbb{C}$, holomorphic $\iff$ analytic $\iff$ Taylor series converges; Cauchy integral formula gives coefficients as contour integrals.