0

I'm attempting to comprehend a passage from the book "Computational Modeling and Visualization of Physical Systems with Python" which I may be mentally fatigued to grasp. Here's the issue: the author states that floating-point operations are inherently susceptible to inaccuracies, where mathematically equivalent expressions can yield differing numerical outcomes. Consequently, this leads to the utilization of various tricks in the pursuit of more precise numerical results. One such tricks is employed to solve the scenario where $a = \sqrt{1 - x^2}$ by expressing it equivalently as follows: Let $b = \sqrt{(1 - x)/(1 + x)}$, so that $\sqrt{1 - x^2} = b + bx$, and $1 - a = 1 - b - bx$. The initial question is: how can this hold true mathematically? Subsequently, the author rewrites $1 - a$ as $$1 - a = 1 - \sqrt{1 - x^2} = \frac{x^2}{1 + \sqrt{1 - x^2}}$$ Once again, I am feeling confused. Could someone provide assistance in comprehending these "equivalences"?

Fitzroy
  • 15

2 Answers2

2

First, we need the "difference of squares" identity, $m^2 - n^2 = (m - n)(m + n)$. You can verify that this is true by expanding out the binomial terms on the right. In particular, this now gives us $1 - x^2 = (1 - x)(1 + x)$.

We can prove the first identity in your question by manipulating the right-hand side until it looks like the left-hand side.

$$\begin{eqnarray} b + bx & = & b(1 + x) \\ & = & \sqrt{\frac{1-x}{1+x}}\left(1 + x\right) \\ & = & \sqrt{\frac{1-x}{1+x}\left(1+x\right)^2} \\ & = & \sqrt{(1-x)(1+x)} \\ & = & \sqrt{1-x^2} \\ & = & a \end{eqnarray}$$

(note that this is only true for $|x| < 1$)

Then for the last identity, we use a trick involving radical conjugates, that exploits the difference of squares again. Notice that $(m + \sqrt{n})(m - \sqrt{n}) = m^2 - (\sqrt{n})^2 = m^2 - n$. Applying that to what you're given, we have:

$$\begin{eqnarray} 1 - a & = & 1 - \sqrt{1 - x^2} \\ & = & \frac{(1 - \sqrt{1 - x^2})(1 + \sqrt{1 - x^2}}{1 + \sqrt{1 - x^2}} \\ & = & \frac{1 - (\sqrt{1 - x^2})^2}{1 + \sqrt{1 - x^2}} \\ & = & \frac{1 - (1 - x^2)}{1 + \sqrt{1 - x^2}} \\ & = & \frac{x^2}{1 + \sqrt{1 - x^2}} \end{eqnarray}$$

ConMan
  • 24,300
0

The simple proof of this is that 1-sqrt(1-x^2) can be multiplied by (1+sqrt(1-x^2))/(1+sqrt(1-x^2)) and then the numerate can be distributed to yield 1 - sqrt(1-x^2) + sqrt(1-x^2) + (1 - sqrt(1 - x^2))^2 which collapses to x^2.