Explaining why $C-A\approx\dfrac{B^2}{2C}$ in a right triangle with hypotenuse $C$ and legs $A$ and $B$, with $B<A$.

73 Views Asked by At

I'll start by saying I'm no mathematician, so excuse my stupid question. I was doing my math homework, CS student, and I stumbled upon this formula for approximating the difference between the hypotenuse and the opposite.

$$C - A = \frac{B^2}{2C}$$ where $C$ is the hypotenuse, $A$ is the opposite, and $B$ is the adjacent.

The formula (?) is more accurate the smaller $B$ is in relation to $A$.

I only came across it because the task at hand required finding the difference which was smaller than what floats allow, so I couldn't use $\sqrt{a^2 + b^2} - a$.

Could anyone explain why it works?

3

There are 3 best solutions below

1
On BEST ANSWER

Notice that $$c-a = \dfrac{(c-a)(c+a)}{c+a} = \dfrac{c^2-a^2}{c+a} = \dfrac{b^2}{c+a}.$$

If $b$ is much smaller than $a$ and $c$, then, $c$ will only be slightly larger than $a$ and so $\dfrac{b^2}{c+a} \approx \dfrac{b^2}{2c}$.

0
On

If $b\ll a$ you have $c\approx a$. Then you can use the following approximation for small $x$: $$\sqrt{1+x}\approx1+\frac x2$$ This comes from keeping the first two terms in the Taylor expansion around $0$. Then $$\sqrt{a^2+b^2}-a=a\sqrt{1+\frac{b^2}{a^2}}-a\\\approx a\left(1+\frac{b^2}{2a^2}\right)-a\\=a+\frac{b^2}{2a}-a\\=\frac{b^2}{2a}\\\approx\frac{b^2}{2c}$$

0
On

If we denote the side lengths by $a, b, c$, expanding in a power series about $b = 0$ gives $$c - a = \sqrt{a^2 + b^2} - a = b \left[\frac{1}{2} \frac{b}{a} - \frac{1}{8} \left(\frac{b}{a}\right)^3 + \cdots\right]$$ and $$\frac{b^2}{2c} = \frac{b^2}{\sqrt{a^2 + b^2}} = b \left[\frac{1}{2} \frac{b}{a} - \frac{1}{4} \left(\frac{b}{a}\right)^3 + \cdots\right] .$$ If $b \ll a$, the first term of the expansion dominates---but the expansions for the two functions have the same first term, so the two quantities should be approximately equal in that case.