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)]))
sage: sqrt(24.)

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)]))
  • $\begingroup$ 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. $\endgroup$ – Ian Apr 10 '16 at 3:48
  • $\begingroup$ @Ian, good point, I didn't feel very confident about that upper bound. How should I have done it? $\endgroup$ – 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.

  • $\begingroup$ If my function is something like $\sqrt{1-x}$, then isn't the $x$ used in the binomial formula supposed to be $-x$? $\endgroup$ – Chewers Jingoist Apr 10 '16 at 3:48
  • $\begingroup$ 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$. $\endgroup$ – user5713492 Apr 10 '16 at 3:52
  • $\begingroup$ I think you mean "binomial coefficients" rather than "derivative values" because I actually chose a binomial series instead of a Taylor series since the higher order derivatives of a square root were becoming too complicated. $\endgroup$ – Chewers Jingoist Apr 10 '16 at 4:01
  • $\begingroup$ In fact, the two things are the same in this context. $\endgroup$ – user5713492 Apr 10 '16 at 4:02
  • 1
    $\begingroup$ 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 :) $\endgroup$ – 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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.