Approximation of a square root of e with a precision of $10^{-3}$ using Taylor formula

1k Views Asked by At

So, I have to approximate a value of square root of e: $\sqrt{e}$ with a precision of $10^{-3}$. I have calculated the first and second derivative: So instead of $\sqrt{e}$ I need to approximate the value for $$\frac{1}{\sqrt[4]{e}}$$ If I follow the formula given by one of the users: $$\displaystyle\sum_{n=0}^{\infty}\frac{x^n}{n!}$$ I gues the result is the same then?

Thanks in advance.

3

There are 3 best solutions below

3
On

$$e^x=\sum_{n=0}^{\infty}\frac{x^n}{n!}$$ so $$e^{0.5}=\sqrt{e}=\sum_{n=0}^{\infty}\frac{0.5^n}{n!}$$ now find the $n$ according to

$$\frac{0.5^n}{n!}<10^{-3}$$

4
On

Since $e^x =\sum_{k=0}^{\infty} \dfrac{x^k}{k!} $, the error after $n$ terms is $e_n(x) =\sum_{k=n}^{\infty} \dfrac{x^k}{k!} $.

If $ 0 < x < 1$, the error can be bounded as,

$\begin{array}\\ e_n(x) &=\sum_{k=n}^{\infty} \dfrac{x^k}{k!}\\ &\lt\sum_{k=n}^{\infty} \dfrac{x^k}{n!}\\ &=\dfrac1{n!}\sum_{k=n}^{\infty} x^k\\ &=\dfrac{x^n}{n!(1-x)}\\ &=\dfrac{1}{n!2^{n-1}} \qquad\text{if } x = \frac12\\ \end{array} $

This is $\frac1{192}$ for $n=4$ and $\frac1{1920}$ for $n=5$, so $n=5$ will work.

2
On

There are some fundamental issues which have yet to be addressed.

In general, our goal is to compute a target value $T \in \mathbb{R}$. Typically, we cannot compute the exact value, so we settle for an approximation $A$. The error is by definition $E = T-A$. The relative error is by definition $R = (T-A)/T$. The relative error is only defined when $T \not =0$. The accuracy of the approximation $A$ is the absolute value of the relative error $R$, i.e., the real number $|R|$.

The use of the word precision is not correct in this context. In numerical analysis, the word precision is used almost exclusively when stating the accuracy of the elementary arithmetic operations. This accuracy is called the machine precision. It is hardware dependent.

Computing $T = \sqrt{e}$ with an accuracy of $\tau = 10^{-3}$ means to find $A$ such that $$|R| = \frac{|T-A|}{|T|} \leq \tau.$$ No more and no less. Now, let $n$ be a nonnegative integer. By Taylor's formula, there exists a $\xi \in (0,\frac{1}{2})$ such that $$ e^{\frac{1}{2}} = \sum_{j=0}^n \frac{1}{j!}\left(\frac{1}{2}\right)^j + \frac{e^{\xi}}{(n+1)!}\left(\frac{1}{2}\right)^{n+1}.$$ This formula is the foundation for our work. It is convenient to do the Taylor expansion at the point $x_0 =0$ rather than anywhere else, simply because all relevant derivatives can be evaluated exactly at $x_0=1$. We therefore focus on the approximation $A_n$ given by $$A_n = \sum_{j=0}^n \frac{1}{j!}\left(\frac{1}{2}\right)^j.$$ We must bound the relative error $R_n$ given by $$ R_n = \frac{T - A_n}{T}.$$ The error $E_n = T - A_n$ satisfies $$ |E_n| = |T - A_n| \leq \frac{e^{\xi}}{(n+1)!}\left(\frac{1}{2}\right)^{n+1}$$ We do not know the exact value of $\xi$. Fortunately, it also irrelevant, because $x \rightarrow e^x$ is increasing. It follows that $$e^{\xi} \leq e^{\frac{1}{2}} = T = |T|.$$ It follows that $$ |E_n| \leq \frac{|T|}{(n+1)!}\left(\frac{1}{2}\right)^{n+1}$$ or equivalently $$ |R_n| \leq \frac{1}{(n+1)!}\left(\frac{1}{2}\right)^{n+1}.$$ It is now straight forward to verify that $n=4$ is the smallest value such that $$ \frac{1}{(n+1)!}\left(\frac{1}{2}\right)^{n+1} \leq \tau = 10^{-3}.$$