# Estimate $\sqrt{24}$ using a power series

The question asks to estimate the value of $\sqrt{24}$ within three decimal places using a power series. The problem is that I get a different answer so there's something I don't understand.

First, I write the function in $x$:

$$f(x) = \sqrt{25-x} = 5\sqrt{1-\frac{x}{25}}$$

Then, I use the Lagrange form of the remainder to compute upper bound of the remainder:

$$\begin{eqnarray} R_n(x) &=& \frac{f^{n+1}(\xi)(x)^{n+1}}{(n+1)!} \textrm{ where } 0 \le \xi \le 1 \\ R_n(1) &\le& \frac{5}{(n+1)!} \end{eqnarray}$$

I set the upper bound of $f^{n+1}(\xi)$ to $5$ because $f(0) = 5$ and all higher order derivatives will be decreasing fractions. I then use trial and error to compute the degree of the polynomial necessary for three decimal places:

$$|R_n(1)| < 0.0005 \\ \frac{5}{(7+1)!} \approx 0.0001 \\$$

I then use the binomial series for $f(x)$ where $m$ is $\frac{1}{2}$ and $x$ in the binomial formula is $-\frac{x}{25}$ from the function:

$$\begin{eqnarray} f(x) &\approx& 5\left[1 + \frac{1}{2}\cdot\frac{1}{1!}\left(\frac{-x}{25}\right)^1 + \frac{1}{2}\cdot\frac{-1}{2}\cdot\frac{1}{2!}\left(\frac{-x}{25}\right)^2 + \frac{1}{2}\cdot\frac{-1}{2}\cdot\frac{-3}{2}\cdot\frac{1}{3!}\left(\frac{-x}{25}\right)^3 + ... \right] \\ &\approx& 5\left[ 1 + \sum_{n=1}^{7} \left(\frac{-x}{25}\right)^n\cdot\frac{(2n-2)!}{2^{2n-1}(n-1)!n!} \right] \\ f(1) &\approx& 4.901 \end{eqnarray}$$

The answer should be $4.899$, so I'm afraid there's something I don't understand that results in a different answer. Any ideas where I went wrong?

Note that to compute the polynomial, I used this script in Sage where I use $x$ instead of $n$ to avoid overwriting the built-in variable by the same name:

sage: f(x) = (-1/25)^x*factorial(2*x-2)/(2^(2*x-1)*factorial(x)*factorial(x-1))
sage: 5.*(1+sum([f(i) for i in range(1, 8)]))
4.90098048640680
sage: sqrt(24.)
4.89897948556636


Also note that I tried increasing the degree of the polynomial and I keep getting $4.901$. For example, this is what I get from $1$ to $99$:

sage: 5.*(1+sum([f(i) for i in range(1, 100)]))
4.90098048640722

• Actually, you will find that $f^{(n)}$ grows with $n$ near $x=0$. The first derivative gives a factor of $1/2$, the second a factor of $-1/2$, but then the third gives a factor of $-3/2$, then $-5/2$, etc. The series still converges for small enough $x$, but you need to be careful about it. – Ian Apr 10 '16 at 3:48
• @Ian, good point, I didn't feel very confident about that upper bound. How should I have done it? – Chewers Jingoist Apr 10 '16 at 3:56

All the terms in your sum are negative after the zero order term. In the sage script, change (-1/25) to (1/25) and then subtract the sum rather than adding it in the next line. The first term that goes wrong is your $x^2$ term, which evaluates to $0.001$, so being high by $0.002$ is the effect you would expect for adding it instead of subtracting.
• If my function is something like $\sqrt{1-x}$, then isn't the $x$ used in the binomial formula supposed to be $-x$? – Chewers Jingoist Apr 10 '16 at 3:48
• Yes, but you also have minus signs from the derivative values, if you go back and look at the series just before you converted it to a summation. $(-1)^{n-1}$ from the derivative and $(-1)^n$ from $\left(-\frac x{25}\right)^n$ and you get $(-1)^{2n-1}=-1$. – user5713492 Apr 10 '16 at 3:52
• Math induction: prove that for $n\ge1$ $$\frac{d^n}{dx^n}(1+x)^{1/2}=\frac{(-1)^{n-1}(2n-2)!}{2^{2n-1}(n-1)!}(1+x)^{\frac12-n}$$ If $n=1$, we get $\frac{(-1)^00!}{2^10!}=\frac12$, and if true for $n$, then \begin{align}\frac{d^{n+1}}{dx^{n+1}}(1+x)^{1/2} & =\frac{(-1)^{n-1}(2n-2)!}{2^{2n-1}(n-1)!}(\frac 12-n)(1+x)^{\frac12-n-1}\\ &=\frac{(-1)^{n-1}(2n-2)!}{2^{2n-1}(n-1)!}\frac{(-1)(2n-1)(2n)}{2^2n}(1+x)^{\frac 12-n-1}\\ &=\frac{(-1)^{(n+1)-1}(2(n+1)-2)!}{2^{2(n+1)-1}((n+1)-1)!}(1+x)^{\frac 12-(n+1)}\end{align} Then true for $n+1$. $(1+0)^{(\frac12-n)}=1$, times $\frac{(x-0)^n}{n!}$ and :) – user5713492 Apr 10 '16 at 4:55
It's because you combined the signs wrongly. You have alternating sign due to the coefficients of the binomial series, and also alternating sign of the power of $-\frac{1}{25}$. They cancel out to give negative sign for every term except the first.