Taylor series approximation explained
A curve is hard to handle and a polynomial is easy. Taylor's idea is to pick one point. At that point the polynomial matches the curve's height, its slope, its bending through the 2nd derivative, and then higher derivatives one after another. Raise the degree and the polynomial copies the curve more faithfully near that point. Even transcendental functions such as sin, cos, and ex are written as polynomials added without end, a power series, and a calculator finds their values this way. Move away from the center and the approximation falls apart. The size of that fall is the remainder, the truncation error, and the numerical analysis in this set is a fight with that error. Where you place the center decides the interval on which the approximation is worth using. Inside that interval the polynomial stands in for the curve. Outside it, the remainder spoils the answer.
Raise the degree slider. Degree 1 is only the tangent line, a straight line, and it leaves the gray curve at once. Raise the degree through 3, 5, and 7 and the gold polynomial wraps the sin curve more widely. At every degree the fit is best near the center, here 0, and it peels away toward either end. A polynomial is bound to diverge far from the center. Add enough terms and, on the interval you can see, it lies almost on top of sin. Leave the slider at the bottom and the gold line is only the tangent. Raise it and the polynomial follows more of the bend.
This time stack ex one term at a time. The first term is the constant 1, the next is x, then x²/2 and x³/6, and each term is xᵏ/k!. The bars below are the size of each term at x=2. They grow at first, then shrink quickly once the factorial (k!) in the denominator takes over. That is why the partial sum settles on one value. Add terms and T(2) approaches the true value e²≈7.39. A function that settles this way for every x is analytic, and ex, sin, and cos are the examples. How far that settling reaches, the radius of convergence, is the next story.
The orange bar is the gap between sin and the gold polynomial, the error. Park the probe x near the center 0 and the bar almost disappears. Drag the probe toward either end and, past some point, the bar suddenly grows long. Raising the degree widens the interval that fits, and outside that interval the error still blows up. What matters in a Taylor approximation is how far you are from the center. That distance, more than any boast of accuracy, sets the error. So you place the center near the point you actually care about. The readout under the bar is the size of that gap.
A Taylor polynomial of degree 1 is one step along the tangent. Measure the slope at a point and step a distance h along that line to predict the next value. The green dashed line is that prediction and the curve is the true value. When h is small the two nearly agree, and when you grow h the orange gap opens. That gap is the remainder of the Taylor step of order 1, the truncation error. This one step is what Euler's method does at every step. It takes the slope from a differential equation and walks forward in straight steps. Approximation and numerical analysis share a root, and the remainder of the polynomial is the error of the numerical method.
Pick a function. Choose sin and set the number of terms to 1, and you get sin x ≈ x. That is the small-angle approximation used for a pendulum and for a small swing, and it fits better as the angle gets smaller. cos starts at 1 − x²/2, and ex starts at 1 + x + x²/2. Calculators and computers find sin, cos, ex, and logarithms with polynomials like these plus a little correction. A machine that can only multiply and add handles transcendental functions this way. You decide the accuracy you need, and you keep that many terms. For a pendulum with a small angle, this one line often stands in for the whole equation of motion.