Calculating the square root of $e$

388 Views Asked by At

I was tasked with Calculating the square root of $e$ up to the error of $10^{-3}$, using the Maclaurin series (Taylor series evaluated at $x=0$).

I got to the stage of $\Big|\frac{e^c}{(n+1)!}\cdot0.5^{(n+1)}\Big| \leq 10^{-3}$ and I know I need to take into account that $C>0$ and that $C<0.5$, but I'm not sure how to continue.

3

There are 3 best solutions below

1
On

If you were asked to approximate using Taylor polynomial I assume that you use $f(x)=e^x$ and that you know that $|R_n(0.5)|\le|\frac{m}{(n+1)!}0.5^{n+1}|$ for $m\ge|f^{(n+1)}(0.5)|$(the center is at $x=0$), here $n$ is the number of elements in the polynomial.

Now the $k$th derivative of $e^x$ is $e^x$, so $f^{(n+1)}(0.5)=e^{0.5}$. So I can choose any upper bound for $m$ as long as it is larger than $e^{0.5}$ so: $e^{0.5}<e<3$ so choose $m=3$ and use this to find $n$ and use that to approximate $\sqrt e$

1
On

An alternative approach (Beuker-style). By integration by parts $$ \int_{0}^{1/2}e^{-x}x^4(2x-1)^4\,dx = 500184-\frac{824664}{\sqrt{e}} \tag{A}$$ where on the interval $\left[0,\frac{1}{2}\right]$ the function $x^4(2x-1)^4$ is non negative and bounded by $\frac{1}{2^{12}}$.
It follows that $\frac{824664}{500184}=\color{blue}{\frac{34361}{20841}}=\color{green}{1.64872127}05\ldots$ gives at least $8$ correct figures of $\sqrt{e}$.

If we consider $\int_{0}^{1/2}e^{-x}x^2(2x-1)^2\,dx$ we get the less accurate but simpler approximation $\sqrt{e}\approx\color{blue}{\frac{61}{37}}$. In this case the approximation error is $\leq 8\cdot 10^{-5}$, hence such approximation is equally fine for the given purpose.

We may also exploit the fact that $\sqrt{e}$ has a simple continued fraction: $$ \sqrt{e}=[1,1,1,1,5,1,1,9,1,1,13,1,1,17,1,1,21,1,1,25,\ldots]\tag{B}$$ where $\frac{34361}{20841}=[1,1,1,1,5,1,1,9,1,1,13,1,1]$ is not accidental. Neither it is accidental that $\frac{61}{37}$ is the value at $\frac{1}{2}$ of the $\{2,2\}$-Padé approximant of $e^x$ centered at $x=0$.

0
On

You know that $e<3$ and $C\leq 1/2$, so $e^C < 3^{1/2} < 2.$ So your expression in the absolute value bars is

$$< \frac{2}{(n+1)!2^{n+1}} = \frac{1}{(n+1)!2^{n}},$$

so you just have to pick $n$ large enough that this last expression is small enough.