Let $f(x) = (1-x)^{-1}$, and i want to find the degree $n$ of a Taylor polynomial centered at $0$, in the interval $[0,0.5]$ such that the error is no greater than $10^{-8}$ when approximating $f(x)$. This has been solved before, expressing the remainder as a geometric series , however i want to solve this using the remainder formula: $$\frac{\lvert f^{(n+1)}(c)\lvert}{(n+1)!} \cdot \lvert(x-\bar{x})^{(n+1)}\lvert\le 10^{-t}$$ The $(n+1)$ derivative of $f(x)$ goes like this: $$(n+1)!(1-x)^{-(n+2)}$$ So now, plugging in the derivative and the values in the remainder formula: $$(1-c)^{-(n+2)} \cdot (0.5)^{n+1}\le10^{-8}$$ I'm stuck here, i tried to plug in the max value on the interval (that is, $0.5$), and try with different values of $n$ until i find the answer, but both $n$ get cancelled. How can i proceed now?, The only way to solve this problem is using the geometric series?
3 Answers
hint
using the fact that $$0 <c <0.5$$ and
$$0.5 <1-c <1$$
We will look for $n $ such that $$\frac {1}{2^{n+1}}<10^{-8} $$
You can finish by logarithm.
- 62,951
The error for a given $x$ and a given $n$ is exactly $\;\dfrac{x^{n+1}}{1-x}$.
Now, if $0\le x\le0.5$, $1-x\ge 0.5$ and $x^{n+1}\le \dfrac1{2^{n+1}}$, hence the error is $\le \dfrac1{2^n}$, so we have to solve $$\frac1{2^n}\le 10^{-8}\iff n\ge\frac{8}{\log 2}\approx 26.6$$ and we'll take $\; n=27$.
- 175,478
-
Oh! yes. Fixed.Thanks for pointing it! – Bernard Aug 26 '17 at 01:02
-
The degree $n$ Taylor polynomial actually has remainder $x^{n+1}/(1-x)$. – Simply Beautiful Art Aug 26 '17 at 01:02
-
Clearly, it's getting late here… – Bernard Aug 26 '17 at 01:05
-
xD Okay man, you can head to bed. Tiny things are of no great importance compared to sleep. – Simply Beautiful Art Aug 26 '17 at 01:05
Here's a nice algebraic approach: (likely what Bernard was aiming for)
$$\begin{align}\frac1{1-x}&=\frac{(1-x)+(x-x^2)+(x^2-x^3)+\dots+(x^n-x^{n+1})+x^{n+1}}{1-x}\\&=1+x+x^2+\dots+x^n+\frac{x^{n+1}}{1-x}\\&=P_n(x)+\frac{x^{n+1}}{1-x}\end{align}$$
For $x\in[0,0.5]$, we have
$$0\le x^{n+1}\le0.5^{n+1}$$
$$1\le\frac1{1-x}\le2$$
$$0\le\frac{x^{n+1}}{1-x}\le0.5^n$$
In particular, you want to solve
$$0.5^n\le10^{-8}$$
$$2^n\ge10^8$$
Recall that
$$2^{10}=1024>1000=10^3$$
Thus,
$$2^n=(2^{10})^{n/10}>10^{3n/10}\ge10^8\\\frac{3n}{10}\ge8\\3n\ge80\\n\ge26.7$$
$$n=27$$
In general, to get the error under $10^{-k}$, we have
$$2^n\ge10^k\\2^n=(2^{10})^{n/10}>10^{3n/10}\ge10^k\\\frac{3n}{10}\ge k\\n\ge\frac{10k}3$$
- 74,685