Find the approximation of $\sqrt{80}$ with an error $\lt 0.001$

Find the approximation of $$\sqrt{80}$$ with an error $$\lt 0.001$$

I thought it could be good to use the function $$f: ]-\infty, 81] \rightarrow \mathbb{R}$$ given by $$f(x) = \sqrt{81-x}$$

Because this function is of class $$C^{\infty}$$, we can compute its Taylor expansion given by :

$$T^n_{0} = 9 - \frac{1}{2}(81)^{-1/2}(x) + \frac{1}{4}(81)^{-3/2}\frac{x^2}{2}-\frac{3}{8}(81)^{-5/2}\frac{x^3}{6}\ + \dotsm$$

By the Lagrange remainder, $$\exists$$ for each $$n \in \mathbb{N}$$, $$c_n \in [0,1]$$ such that :

$$R^n(1) = f^{n+1}(c) \frac{1-0^{n+1}}{(n+1)!} = f^{n+1}(c) \frac{1}{(n+1)!} \leq 9.\frac{1}{(n+1)!} \lt 10^{-3}$$

$$=> n(+1)! \gt \frac{9}{10^{-3}} = 9000$$

So we can take $$n = 8$$

The approximation seems a little bit tricky to calculate especially without a calculator. I'm wondering if everything above is correct ?

• You can use continued fractions – Klangen Aug 7 '19 at 10:28
• $n=8$ terms in the Taylor expansion seems way to many. Newtons method should work for these kind of problems very well. – quarague Aug 7 '19 at 10:38
• The first few derivatives are actually decreasing with n, even when you evaluate them at the worst possible point i.e. 80. This should reduce the number of Taylor terms needed considerably. For example if you only retain up to the quadratic term then the error won't be much more than $1/(16 \cdot 9^5)$ which is good enough. – Ian Aug 7 '19 at 12:17
• Retaining only the linear term is actually good enough for $10^{-3}$ error as well. – Ian Aug 7 '19 at 12:31
• You have a sign error: the third term should be $-\dfrac14(81)^{-3/2}\dfrac{x^2}{2}$. – TonyK Aug 7 '19 at 17:12

Here's what I think you meant:

Let $$f(x)=\sqrt{81-x}$$. Then $$f'(x)=\dfrac{-1}{2\sqrt{81-x}}$$ and $$f''(x)=\dfrac1{4(81-x)^{3/2}}.$$

The Maclaurin series (Taylor series about $$x=0$$) for $$f(x)$$ is given by

$$T(x) = 9 - \frac{1}{2}(81)^{-1/2}(x) - \frac{1}{4}(81)^{-3/2}\frac{x^2}{2}\dotsm$$

By the Lagrange remainder, for each $$n \in \mathbb{N}$$, there is $$c_n \in [0,1]$$ such that

$$R^n(1) = f^{n+1}(c) \frac{x^{n+1}}{(n+1)!} = f^{n+1}(c) \frac{1}{(n+1)!}.$$

Now for $$c\in[0,1], |f(c)|\le9, |f'(c)|\le\dfrac1{2\sqrt{80}}<\dfrac1{2\sqrt{64}}=0.625,$$ and $$|f''(c)|\le\dfrac1{4(80)^{3/2}}<\dfrac1{4(64)^{3/2}}=\dfrac1{2048}<0.001$$.

So $$R^1(1)<0.001,$$ so $$9 - \frac{1}{2}(81)^{-1/2}=\dfrac{161}{18}$$ is a sufficiently good approximation of $$\sqrt{80}.$$

Use $$\sqrt{80}=9\sqrt{1-\frac{1}{81}}$$. Now the Taylor series converges much faster: you only need $$\sqrt{1-x}=1-\frac12x+O(x^2)$$

We get $$9\left(1-\frac12\cdot\frac{1}{81}\right)=9-\frac{1}{18}=8.94444\ldots$$ with an error of $$0.00017\ldots$$

• It doesn't actually converge faster. It's actually the same series after you distribute the $9$ through (you've just moved the powers of $81$ that appear in the derivatives in the expansion of $\sqrt{81-x}$ and moved them into the $x$ itself). And Lagrange gives the same error estimate as well. OP just didn't properly take into account the decay of $f^{(n+1)}$ with increasing $n$ in their approach. – Ian Aug 7 '19 at 12:25
• @Ian: Yes, of course the series are the same. How could they not be? Now I feel foolish. – TonyK Aug 7 '19 at 17:17

You can firstly remove the 16 out of the root and leave $$4\sqrt{5}$$ calculating only the smaller square root five, and use any existing method to approximate the five, but if you're not sure whether or not you can remove anything from the root, just go on with the following method:

Using the Babylonian method:

1. Make an approximate guess of the possible root: In our case $$x_0 = \sqrt{80} \approx 9$$
2. Use the formula $$\frac12 \left(x_n + \frac{S}{x_n}\right)$$ - the often, the preciser the output.
• We have $$x_0 = 9$$ and $$S = 80$$ here.
• $$x_0 = 9$$
• $$x_1 = \frac12 \left(x_0 + \frac{S}{x_0}\right) = \frac12 \left(9 + 8 \frac89\right) = \frac{161}{18} = 8.9(4)$$
• $$x_2 = \frac12 \left(x_1 + \frac{S}{x_1}\right) = \frac12 \left(\frac{161}{18} + \frac{80}{\frac{161}{18}}\right) = \frac12 \left(\frac{161}{18} + \frac{1440}{161}\right) = 8.94427192...$$
• You can do it as much as you want, but usually the third time you re-calculate using the formula it should be accurate enough.

$$x_n = 8.94427192..$$ (method)
$$\sqrt{80} = 8.94427191..$$ (calculator)

This is also the method computers use (it's the shortest), but you need to be able to work with fractions.

You can actually start with any $$x_0$$, but the accurate you guess, the less times you need to use the formula. Read more about accuracy here.

Note that $$(9-\sqrt{80})(9+\sqrt{80})=1$$ and $$(9\pm\sqrt{80})^2=161\pm18\sqrt{80}$$. It follows that

$$0\lt{161\over18}-\sqrt{80}={1\over18(161+18\sqrt{80})}\lt{1\over10\cdot100}={1\over1000}$$

(Note, this results in the same approximation as in several other answers, including the accepted answer. The main feature here is that it is entirely self contained: No knowledge of calculus or continued fractions is required.)

Hint

I do not think that you need so many terms since, by Taylor (as you did), $$\sqrt{81-x}=9-\frac{x}{18}-\frac{x^2}{5832}+O\left(x^3\right)$$ Using the above with $$x=1$$ gives $$\frac{52163}{5832}\approx 8.9442730$$ while $$\sqrt{80} \approx 8.9442719$$.

Since $$\sqrt{80}=[8,\overline{1,16}]$$ (continued fraction) and $$[8,1]=9,\quad [8,1,16]=\frac{152}{17},\quad [8,1,16,1]=\frac{161}{18},\quad [8,1,16,1,16]=\frac{2728}{305}$$ we have $$\left|\sqrt{80}-\frac{161}{18}\right|<\frac{1}{18\cdot 305}<\frac{1}{1000}$$.

• I got $\frac{161}{18}$ too, using a completely different method (see my answer). – TonyK Aug 7 '19 at 12:10
• @TonyK: well, that is not completely different: if properly configured, the babylonian method travels through the convergents of the CF. – Jack D'Aurizio Aug 7 '19 at 13:38

Since $$8^2 = 64$$ and $$9^2 = 81$$ and $$81 - 64 = 17$$, using $$8.9$$ as an estimate for $$\sqrt {80}$$ is more than just a lucky guess. Since

$$\quad (8.9)^2 < 80 \text{ and } (9)^2 > 80$$

we must have

$$\quad 0 \lt \sqrt{80} - 8.9 \lt 0.1$$

Define the function

$$\tag 1 F(x) = \frac{8.9x + 80}{x+8.9}$$

For $$x \ne -8.9$$ we have the following identity,

$$\tag 2 F(x) - \sqrt{80} = (x - \sqrt{80}) \, (x + 8.9)^{-1} \, (8.9 - \sqrt{80})$$

Since $$(8.9 + 8.9)^{-1} \lt 0.1$$ the following must be true

$$\tag 3 |F(8.9) - \sqrt{80}| \lt (0.1)^3 = 0.001$$

All that remains is to evaluate $$F(8.9)$$,

$$\tag 4 F(8.9) = \frac{15921}{1780}$$


\begin{align} \begin{array}{rclcl} \ds{x_{1}} & \ds{=} & \ds{{1 \over 2}\pars{9 + {80 \over 9}}} & \ds{=} & \ds{8.944\color{red}{4}}\ldots \\ \ds{x_{2}} & \ds{=} & \ds{{1 \over 2}\pars{x_{1} + {80 \over x_{1}}}} & \ds{=} & \ds{8.9442719\color{red}{1}\ldots} \\ \ds{x_{3}} & \ds{=} & \ds{{1 \over 2}\pars{x_{2} + {80 \over x_{2}}}} & \ds{=} & \ds{8.9442719099991\color{red}{6}\ldots} \end{array} \end{align}

WolframAlpha $$\ds{\implies}$$

$$\ds{\root{80} = 8.944271909999158785636694674925104941762473438446102897083\ldots}$$

You can generate your own table with a $$\ds{\tt javascript}$$ script as follows:
// nr14jun2020.js
"uses strict";
// command line: node nr14jun2020.js
/************************************/
let n = 0, rt = 9;
while ( n < 10 ) {
rt = (rt + 80/rt)/2;
console.log(rt.toPrecision(21));
++n;
}


Barry Cipra's answer does everything that is required with no fuss at all, so it gets my vote, but I was still curious to know how much work it would be to get the result using the binomial series. Not a lot, I think: $$1 - \sqrt{1 - x} = \tfrac{1}{2}\sum_{k=0}^\infty a_kx^{k+1} \quad (|x| < 1), \qquad a_k = \frac{1\cdot3\cdots(2k-1)}{4\cdot6\cdots(2k+2)}, \qquad a_0 = 1, \ a_1 = \tfrac{1}{4}.$$ Because $$a_{k+1} < a_k$$, we can estimate the remainder using the geometric series: $$0 < 1 - \sqrt{1 - x} - \tfrac{1}{2}\sum_{k=0}^{p-1} a_kx^{k+1} < \frac{a_px^{p+1}}{2(1 - x)} \quad (p \geqslant 0, \ 0 < x < 1),$$ In the present case, it is enough to take $$p = 1$$: $$0 < 1 - \frac{x}2 - \sqrt{1 - x} < \frac{x^2}{8(1 - x)} \quad (0 < x < 1).$$ Taking $$x = \frac1{81},$$ and multiplying throughout by $$9,$$ we get $$x/(1 - x) = \frac1{80},$$ and so $$0 < \frac{161}{18} - \sqrt{80} < \frac1{8 \times 9 \times 80} = \frac1{5760}.$$ In fact, \begin{align*} \frac{161}{18} - \sqrt{80} & \bumpeq 0.0001725, \\ \frac1{5760} & \bumpeq 0.0001736. \end{align*}