# Question

Estimate the error that results when $\sqrt{1 + x}$ is replaced by $1 + \frac{1}{2}x$ if $|x| < 0.01$

# Definition

Taylors formula is $f(x) = P_n(x) + R_n(x)$ where $P_n(x)$ is

\begin{aligned} P_n(x) = f(a) + \frac{f'(a)}{1!}(x - a) + \frac{f''(a)}{2!}(x - a)^2 & + \ldots + \frac{f^{(n)}(a)}{n!}(x - a)^n \\ \end{aligned}

And $R_n (x)$ is (\emph{where $\xi$ is between $a$ and $x$ }) \begin{aligned} R_n(x) = \frac{f^{(n + 1)}(\xi)}{(n + 1)!}(x - a)^{(n + 1)} \end{aligned}

# Working

I'm not sure how to go about this, would I say that this is a first order approximation as

\begin{aligned} P(x) & = 1 - \frac{1}{2}x \\ P'(x) &= - \frac{1}{2} \\ P''(x) &= 0 \end{aligned}

Then the remainder term would be

\begin{aligned} R_n(x) = \frac{f^{(n + 1)}(\xi)}{(n + 1)!}(x - a)^{(n + 1)} \end{aligned}

Where $n + 1 = 2$. For $f(x) = \sqrt{1 + x}$ this would be

\begin{aligned} R_n(x) & = \frac{- \frac{1}{4} (1 + \xi)^{-3/2}}{(3)!} \end{aligned}

And $\xi$ is between $-0.01$ and $0.01$

This would give the maximum error as

\begin{aligned} R_n(x) & = \frac{- \frac{1}{4} (1 \pm 0.01 )^{-3/2}}{(3)!} \approx -0.0423 \end{aligned}

The error is greatest when $\xi = -0.01$.

• Maybe you mean $1+ \frac {x}{2}$ Commented Jul 23, 2017 at 16:11
• @I.Padilla yes, I've updated , thanks
– baxx
Commented Jul 23, 2017 at 16:13
• I've updated the working
– baxx
Commented Jul 23, 2017 at 16:18
• Next time verify your result computing directly $\sqrt{x+1}-1-\frac{1}{2}\,x$ in the worst case, in $[-0.01,\;0.01]$. The error is maximum when $x=0.01$ and is about $0.0000124$ in absolute value. This is NOT how to solve the problem but is a way to be less wrong :) Commented Jul 24, 2017 at 12:12

expanding about $x=0$ \begin{aligned} P_n(x) = f(0) + \frac{f'(0)}{1!}(x - 0) + \frac{f''(a)}{2!}(x - 0)^2 & + \ldots + \frac{f^{(n)}(0)}{n!}(x - 0)^n \\ \end{aligned}\\ \begin{aligned} P_n(x) = 1 + \frac{1}{2}x + \frac{-\frac14}{2!}x^2 & + \ldots \end{aligned}\\so w..r.t.$|x| < 0.01$ \begin{aligned} R_n(x) & = \frac{- \frac{1}{4(1 + \xi)^{+3/2}} }{2!} \end{aligned}\leq \frac{- \frac{1}{4} (1 + (-0.01))^{-3/2}}{2!}=\frac{- \frac{1}{4} (0.99)^{-3/2}}{2!}

• Thanks, I'm not sure where $$P_n(x) = 1 + \frac{1}{2}x + \frac{-\frac14}{2!}x^2$$ has come from. The first two terms of that were given as the approximation, but the third term? If I write out the approximation for the given function I have $$P(x) = 1 + \frac{1}{2}(1 + x)^{-1/2} + \frac{-\frac{1}{4}(1 + x)^{-3/2}}{2!}(x - a)^2$$ The last term of which is error term, yet you've not used $(x - a)$.
– baxx
Commented Jul 23, 2017 at 16:40

You can just expand $f(x) \approx 1+\frac 12x-\frac 18x^2+\ldots$ as a Taylor series. The first two terms of the replacement are correct, so the error for small $x$ is dominated by the $-\frac 18x^2$ term. The error will then be negative and no less than $-\frac 18(0.01)^2=-.0000125$

• This works only for positive $x$s. Commented Jul 23, 2017 at 16:36
• @Bernard: why do you say that? The $1$ makes sure the argument of the square root is positive. This Alpha graph shows it Commented Jul 23, 2017 at 18:26
• I was mentioning only the error estimate: if $x<0$, you no more have an alternating series, so the absolute value of error might be greater than$\frac18x^2$. Commented Jul 23, 2017 at 18:56
• @Bernard: that is true, but we were asked to estimate the error, not bound it. The quadratic term will swamp any higher order term. In fact the error at $x=-.01$ is $-0.0000125629\ldots$ so it is (barely) outside the number I quoted. Commented Jul 23, 2017 at 19:00
• From this point of view (a physicist one!) I agree with you. Commented Jul 23, 2017 at 19:35

You have that

$$f(x)=f(0)+\dfrac{f'(0)}{1!}x+R_1(x).$$ Since $f(x)=\sqrt{1+x}$ it is $f(0)=1$ and $f'(0)=\dfrac 12.$ Thus

$$\sqrt{1+x}=1+\dfrac{1}{2}x+R_1(x).$$

Now, $$R_1(x)=\dfrac{f''(\xi)}{2!}x^2.$$ Since $$f''(\xi)=-\dfrac14 (1+\xi)^{-3/2}$$ we get

$$\sqrt{1+x}-\left(1+\dfrac{1}{2}x\right)=-\dfrac18 (1+\xi)^{-3/2}x^2.$$ Now, if $|x|\le 0.01$ we have to get a bound for the RHT. We have that

$$\dfrac18 (1+\xi)^{-3/2}x^2\le \dfrac{0.01^2}{8},$$ where we have used that $$(1+\xi)^{-3/2}\le 1.$$

Usually the Laplace integral form of the remainder yields a tighter estimate of the error. At order $1$, it is $$R_1(x)=\int_0^x\!\frac{f''(t)}{2!}(x-t)\,\mathrm d\mkern1mu t=-\frac18\int_0^x\!\!\frac 1{(1+t)^{3/2}}(x-t)\,\mathrm d\mkern1mu t$$ Let's compute this integral: \begin{align} \int_0^x\!\!\frac 1{(1+t)^{3/2}}(x-t)\,\mathrm d\mkern1mu t &=\int_0^x\!\!\frac {(x+1)-(1+t)}{(1+t)^{3/2}}\,\mathrm d\mkern1mu t \\ &=(x+1)\int_0^x\!\!\frac {1}{(1+t)^{3/2}}\,\mathrm d\mkern1mu t -\int_0^x\!\!\frac {1}{\sqrt{1+t}}\,\mathrm d\mkern1mu t\\ &=(x+1)\ \frac{-2}{\sqrt{1+t}}\Biggr\vert_0^x-2\sqrt{1+t}\,\biggr\vert_0^x \\ &=-2\sqrt{x+1}+2(x+1)-2\sqrt{x+1}+2\\ &=2\bigl(\sqrt{x+1}-1\bigr)^2 \end{align} As on $(-0.01, 0.01)$, we have $-0.02<\sqrt{x+1}-1<0.02$, so that the integral is non-negative and $<0.0004$, and finally $$-5\cdot 10^{-5}<R_1(x)\le 0.$$