Help understand Taylor's theorem - “when” does a function becomes linear?

It is known that for relatively small intervals around some value (say $a$), any (any?) continuous and differentiable function $f$ can be approximated (in the region of the interval) to a linear function via Taylor's theorem with: $f(x) = f(a) + f'(a)*(x-a) + h_k(x)(x-a)$

How is this notion defined more precisely? For example, say that I take the function $x^2$, and I am interested in a region around $x=1$, how can I say how close my function is to linear, as the region around 1 becomes smaller?


Near the value $x = 1$, the function $f(x) = x^2$ is well approximated by the linear function $$ x \mapsto 2x - 1 $$ because $f(1) = 1$ and $f'(1) = 2$.

When you ask "How big an interval is it well-approximated on?" you're asking something like:

"Is $E(x) = x^2 - (2x - 1)$ very different from $0$?" or more generally, for any function $f$ and location $a$,

"Is $E(x) = f(x) - (f(a) + f'(a)(x-a))$ very different from $0$?"

That "error function" can be arbitrarily different from $0$ on any interval you name, i.e., I can find a function with the same value and derivative, but which moves away from the approximating linear function as fast as you like.

But a partial bound is given by knowing that near $a$, $f$ is generally even better approximated by $$f(a) + f'(a) (x - a) + \frac{1}{2} f''(a) (x-a)^2. $$

So if you want the error to be no more than, say, 0.3, then you just choose $a$ so that $\frac{1}{2} f''(a) (x - a)^2$ is no larger than $0.3$. That won't work perfectly, but for many functions it'll come pretty close.

A good example to keep in mind is this:

The special case where the point of approximation is $x = 0$, and the derivative there is $f'(0) = 0$. Then you're asking "If I know that $f(0) = 0$ and $f'(0) = 0$, can I be sure that $|f(x)| < C$ (for some small number $C$) as long as $x$ is within (say) $0.1$ of $0$?

The answer is a resounding "no". Consider the function: $$ f(x) = Ax^2 $$

It has both the properties ($f(0) = f'(0) = 0$) and hence near $0$ is well-approximated by the line $y = 0$. But on the interval $-0.1 < x < 0.1$, the function ranges from $0$ to $\frac{A}{100}$. If $A$ happens to be a million, that's a pretty big range!


Consider the Lagrange Error bound.

For a LINEAR function (which is a polynomial approximation of degree $1$), the error is given by $\displaystyle E\leq\left|\frac{1}{2}\max(|f''(x)|)(x-a)^2\right|$

To generalize, for any degree (n) Taylor approximation (one using derivatives), the error is given by $\displaystyle E \leq \left|\frac{1}{(n+1)!}\max\left(\left|f^{n+1}(x)\right|)(x-a\right)^{n+1}\right|$

Let's say that you want to find the maximum error on $(x_1,x_2)$. Then your $(x-a)$ would be whichever of $x_1$ or $x_2$ is the farthest from $a$. Your $f^{n+1}(x)$ would be the highest value of that derivative on the interval $(x_1,x_2)$.

Also keep in mind that this is the maximum possible error.