How to prove $P(x)=1-\frac{x^2}{2}$ is a good approximation of order $3$ for $f(x)=\cos x$ near $x=0$?

370 Views Asked by At

Let $f$ be a function and we want to approximate $f$ using a different function $P$ near $x=0$. The error of approximation is $E(x)=f(x)-P(x)$. If the approximation is going to be any good, we want $\lim\limits_{x\rightarrow 0}E(x)=0$. In fact, we want $E(x)$ approaches $0$ fast as $x\rightarrow 0$

Definition for $good \ approximation$: we say that $P$ is a good approximation of order $n$ for $f$ near $x=0$ when $E(x)$ approaches $0$ faster than $h_n(x)=x^n$.

Definition for $approache\ 0\ faster$: Assume $\lim\limits_{x\rightarrow 0}f(x)=\lim\limits_{x\rightarrow 0}g(x)=0$. We say $\lim\limits_{x\rightarrow 0}f(x)$ approaches $0$ faster than $g(x)$, as $x\rightarrow 0$, when $\lim\limits_{x\rightarrow 0}\frac{f(x)}{g(x)}=0$.

How to prove $P(x)=1-\frac{x^2}{2}$ is a good approximation of order $3$ for $f(x)=\cos x$ near $x=0$?

Here is my try:

We have $E(x)=f(x)-P(x)=\cos x -1+\frac{x^2}{2}$. Since $E(x)$ and $x^3$ are continuous and $E(0)=0^3=0$, then $\frac{E(x)}{x^3}=\frac{\cos x -1+\frac{x^2}{2}}{x^3}=\frac{\frac{\cos x}{x^2}-\frac{1}{x^2}+\frac{1}{2}}{x}$. Clearly $\lim\limits_{x\rightarrow 0}\frac{E(x)}{x^3}=0$. I think we can conclude that $P$ is a good approximation as $E(x)$ approaches $0$ faster than $x^3$.

However I am sure the steps shouldn't be this simple. Could someone help?

4

There are 4 best solutions below

2
On BEST ANSWER

Your mostly done already. The only jump in logic is the statement that

"Clearly $\lim\limits_{x\rightarrow 0}\frac{E(x)}{x^3}=0$."

This is not clear based on the previous line as the prior line if you were to plug in 0 would get you 0 over 0. You can deal with this by using L'Hospital's rule.

$\lim\limits_{x\rightarrow 0} \frac{E(x)}{x^3} = \lim\limits_{x\rightarrow 0} \dfrac{\frac{\cos x}{x^2} - \frac{1}{x^2} + \frac{1}{2}}{x}$

$= \lim\limits_{x\rightarrow 0} -\frac{x^2\sin x + 2x\cos x}{x^4} +\frac{2}{x^3} = \lim\limits_{x\rightarrow 0} \frac{2}{x^3} - \frac{x\sin x + 2\cos x}{x^3} = \lim\limits_{x\rightarrow 0} \frac{2-x\sin x -2\cos x}{x^3}$

Applying L'Hospital's rule a few more times and,

$\lim\limits_{x\rightarrow 0} -\frac{x\cos x + \sin x - 2\sin x}{3x^2} = \lim\limits_{x\rightarrow 0} -\frac{x\cos x - \sin x}{3x^2} = \lim\limits_{x\rightarrow 0} -\frac{\cos x - x\sin x - \cos x}{6x} =\lim\limits_{x\rightarrow 0} -\frac{\sin x}{6} = 0$

which completes the problem. In practice, you would normally just apply taylor's theorem assuming you know your function has enough derivatives (and $\cos x$ has as many derivatives as you can want).

0
On

What you did looks OK to me.

The function $P(x) = 1 - \tfrac12 x^2$ is the first two terms of the Taylor expansion of $\cos x$ around $x=0$. The remaining terms of the Taylor expansion are of degree 4 or higher. In fact $$ E(x) = \cos x - P(x) = \left(1 - \tfrac12x^2 + \tfrac1{24}x^4 + \cdots\right) - \left(1 - \tfrac12x^2\right) = \tfrac1{24}x^4 + \text{higher order terms} $$ Then, everything you're asked to prove follows fairly easily from this.

0
On

Since the power series of the cosine is alternating for any $x$, the estimates for alternating series apply. Thus $$ 1-\frac{x^2}2\le\cos x\le 1-\frac{x^2}2+\frac{x^4}{24} $$ giving a fourth degree error bound.

0
On

Your analysis is solid. There is the matter of showing that

$$\lim_{x\to 0}\frac{\cos(x)-\left(1-\frac12 x^2\right)}{x^3}= 0 \tag 1$$

Of course one can simply use The Extended Law of the Mean for the cosine function and write

$$\cos(x)=1-\frac12 x^2 +O\left(x^4\right)$$

However, I thought that it might be instructive to present an approach that does not rely on knowledge of differential calculus. Rather, we need only rely on the inequalities from elementary geometry

$$|\theta \cos(\theta )|\le |\sin(\theta )|\le |\theta | \tag 2$$

for $|\theta |\le \pi/2$ along with the trigonometric half-angle formulae and the squeeze theorem. To that end, we proceed.


We first square $(2)$ and let $\theta =x/2$ to obtain

$$\frac{x^2}{4}\cos^2(x/2)\le \sin^2(x/2)\le \frac{x^2}{4} \tag 3$$


Next, we use the half-angle formulae

$$\begin{align} \sin^2(x/2)&=\frac{1-\cos(x)}{2} \tag 4\\\\ \cos^2(x/2)&=\frac{1+\cos(x)}{2} \tag 5\\\\ \end{align}$$

Substituting $(4)$ and $(5)$ into $(3)$ and rearranging reveals

$$1-\frac12 x^2 \le \cos(x)\le \frac{1-\frac14 x^2}{1+\frac14 x^2} \tag 6$$

whereupon subtracting $1-\frac12 x^2$ from $(6)$ yields

$$0\le \cos(x)-\left(1-\frac12 x^2\right)\le \frac{\frac18 x^4}{1+\frac14 x^4} \tag 7$$


Finally, applying the squeeze theorem to $(7)$ results in the coveted limit given in $(1)$

$$\bbox[5px,border:2px solid #C0A000]{\lim_{x\to 0}\frac{\cos(x)-\left(1-\frac12 x^2\right)}{x^3}= 0 }$$

And we are done!