Rewriting squareroot function in the form (a-b)(a+b)?

40 Views Asked by At

enter image description here

I have this function and I'm trying to write a program to compute it as n approaches 100. The problem is it overflows once it reaches around 50. The hint to solving this question is to rewrite the part inside the parentheses (sqrt(1+2^-n*Xn) - 1) to (a-b)(a+b), but I'm having trouble thinking of how to do that.

2

There are 2 best solutions below

0
On BEST ANSWER

Well, $(a+b)(a-b)$ is $a^2 - b^2$, so perhaps you treat the two terms as $a^2$ and $b^2$ to get:

$$x_{n+1} = 2^{n+1}((1+2^{-n}x_n)^{1/4} + 1)((1+2^{-n}x_n)^{1/4} - 1)$$

Maybe this helps?

0
On

Try something like this, assume $x>0$:

$$\sqrt x-1= (x^{1/4})^2-1=(x^{1/4} -1)(x^{1/4}+1). $$

But I am not sure that it will be easier now.