Is there any formula for the expansion of $|a-b|^{2}$ ? Can I expand it in the same way as $(a-b)^{2}$?
Asked
Active
Viewed 4.3k times
2 Answers
18
We have $|a-b|^2=(a-b)^2$. No difference! For $|a-b|=a-b$ if $a\ge b$, and $|a-b|=-(a-b)$ if $a\lt b$. Now recall that in general $(-x)^2=x^2$.
Remark: In our answer, we assumed that $a$ and $b$ are real numbers, or variables that range over the reals. In the complex numbers, there is a notion of absolute value, usually called the norm of the complex number. In that setting, the answer becomes more complicated.
André Nicolas
- 507,029
-
what if b is of the form e^(ja) ? – user13267 Feb 14 '13 at 00:04
-
@user13267: One can get an expression using the polar form. This takes us well beyond the question that was asked. If you are curious about detauls, do ask a separate question. – André Nicolas Feb 14 '13 at 00:13
7
Yes, $$ |a-b|^2=(a-b)^2. $$ The left hand side is just the number $x=|a-b|$ squared, while the right hand side is the number $y=(a-b)$ squared. But $x$ and $y$ differ at most by a sign, i.e. $x=y$ or $x=-y$ and hence if you square them, they are equal.
Stefan Hansen
- 25,582
- 7
- 59
- 91