How is the restructuring $x=\frac{c}{b+\sqrt{b^2-c}}$ of the Quadratic Formula for $x^2-2bx+c=0$ done?

63 Views Asked by At

I am studying how computers are solving mathematical problems to avoid errors but there is a mathematical formulation I don't understand.

So lets say we have an equation $x^2-2bx+c=0$ where $c=1$, $b=10^{10}$ with two roots: $x_1=2 · 10^{10}$ and $x_2 = 5 · 10^{−11}$ which are correct to 16 digits.

Looking at my professors notes below I don't understand how "difference of squares formula" can be used in any way to get: $$ x_2 = \frac{c}{b+\sqrt{b^2-c}} $$

Quadratic formula is first used to obtain: enter image description here

2

There are 2 best solutions below

1
On BEST ANSWER

Observe that,

$$\begin{aligned} x_2 &= b - \sqrt{b^2 - c} \\ &= (b - \sqrt{b^2 - c}) \frac{b + \sqrt{b^2 - c}}{b + \sqrt{b^2 - c}}\\ &= \frac{(b - \sqrt{b^2 - c})(b + \sqrt{b^2 - c})}{b + \sqrt{b^2 - c}}\\ &= \frac{b^2 - (b^2 - c)}{b + \sqrt{b^2 - c}}\\ &= \frac{c}{b + \sqrt{b^2 - c}}. \end{aligned}$$

0
On

The "difference of squares" formula is also known as a "numbered" binomial formula (2nd or 3rd, per local convention), $$ A^2-B^2=(A-B)(A+B). $$


If you want to compute $\sqrt{A+B}-\sqrt{A}$ where $|B|\ll A$, so that in a floating point data type the last digits of $B$ are lost in the sum $A+B$, while in the difference of the square roots the leading digits that are only contributed by $A$ cancel. Getting an error in the last digit of the number format is expected, but the evaluation of this expression can lose a large number of valid digits.

A more exact floating point result for that expression can be computed by expanding to apply the binomial formula $$ \sqrt{A+B}-\sqrt{A}=\frac{(A+B)-A}{\sqrt{A+B}+\sqrt{A}} =\frac{B}{\sqrt{A+B}+\sqrt{A}}. $$ Here the sum $A+B$ still discards the last digits of $B$ in a numerical evaluation, but these would not occur in the result anyway, as the denominator is now a sum of two approximately equal numbers.