Explain why $(a−b)^2 = a^2 −b^2$ if and only if $b = 0$ or $b = a$. This is a question out of "Precalculus: A Prelude to Calculus" second edition by Sheldon Axler. on page 19 problem number 54.
The problem is Explain why $(a−b)^2 = a^2 −b^2 $ if and only if $b = 0$ or $b = a$.
So I started by expanding $(a−b)^2$ to $(a−b)^2 = (a-b)(a-b) = a^2 -2ab +b^2$. To Prove that $(a−b)^2 = a^2 −b^2 $ if b = 0 I substituted b with zero both in the expanded expression and the original simplified and I got $(a−b)^2 = (a-0)^2 = (a-0)(a-0) = a^2 - a(0)-a(0)+0^2 = a^2$ and the same with $a^2 -2ab +b^2$ which resulted in $a^2 - 2a(0) + 0^2 = 2a$ or if I do not substite the $b^2$ I end up with $a^2 + b^2$. That's what I got when I try to prove the expression true for $b=0$. 
As for the part where $b=a$, $(a−b)^2 =  (a-b)(a-b) = a^2-2ab+b^2$, if a and b are equal, let $a=b=x$ and I substite $a^2-2ab+b^2 = x^2-2(x)(x) + x^2 = x^2-2x^2+x^2 = 1-2+1=0$ I do not see where any of this can be reduced to $a^2-b^2$ unless that equals zero......I do see where it holds but I do not see how would a solution writting out look.After typing this it seems a lot clearer but I just can't see how to phrase a "solution".
P.S: This is my first time asking a question here so whatever I did wrong I am sorry in advance and appreciate the feedback.
 A: It might just be easier to use that $a^2-b^2=(a-b)(a+b)$.
So if $a-b=0$ then $(a-b)^2=(a-b)(a+b)$, and if $a-b\neq 0$ then $(a-b)^2=(a-b)(a+b)$ if and only if $a-b=a+b$.
A: Hint:  $(a−b)^2 = a^2 −b^2 \iff (a−b)^2 - a^2 +b^2=0 \iff 2b(b-a)=0\,$.
A: 
which resulted in $a^2 - 2a(0) + 0^2 = 2a$

$a^2 - 2a(0) + 0^2 = a^2$, not $2a$.

or if I do not substitute the $b^2$ I end up with $a^2 + b^2$.

Why would you not substitute the $b^2$?  If you're substituting $b=0$ then you need to do it in all occurrences of $b$.  This includes $b^2$.  When you do this you'll see that the equation $(a-b)^2 = a^2 - b^2$ reduces to $a^2 = a^2$, which is certainly a true statement for all values of $a$.
Also, you're overcomplicating the $a=b$ case.  No need to introduce a new variable $x$.  If $a = b$, then you can simply substitute either one in for the other.  Let's replace $a$ with $b$.  Then we have
$$ (a-b)^2 = (b-b)^2 = 0^2 = 0$$
and on the other hand we have
$$ a^2 - b^2 = b^2 - b^2 = 0 $$
This shows that $(a-b)^2 = a^2 - b^2$ if $a = b$.
I should also point out that the work you've done (or at least the work you've shown us) only proves one direction.  You're asked to prove the following:
$$ (a-b)^2 = a^2 - b^2 \text{ if and only if } b = 0 \text{ or } a = b $$
But what you've done so far is:
$$ (a-b)^2 = a^2 - b^2 \text{ if } b = 0 \text{ or } a = b $$
In other words, you need to handle the "only if" part.  Do this by assuming $(a-b)^2 = a^2 - b^2$ and showing that the only two possibilities are $b=0$ or $a=b$.  At least one of the other current answers offers guidance on this matter.
A: This is a geometrical approach.
Let $a-b=d$. Then $d^2 + b^2 = a^2$ and the using Converse of Pythagoras theorem there must be a triangle having $a, b, a-b$ as sides, which is impossible because $b + (a - b) = a \not \gt a$.
A: we have $$(a-b)^2=a^2-b^2$$ we know that $$(a-b)^2=a^2+b^2-2ab$$ and if we use the first equation we get
$$2b^2-2ab=0$$ thus we get $$b=0$$ or $$b=a$$
A: You have to prove two things:
1) If $b = 0$ or $b = a$ then $(a-b)^2 = a^2 - b^2$.
And 
2) If $(a-b)^2 = a^2 - b^2$ then either $b = 0 $ or $b = a$.
To prove 1: we do what you did correctly:
If $b = 0$ then $(a - b)^2 = (a-0)^2 = a^2$.  An $a^2 - b^2 = a^2 - 0^2 = a^2 - 0 = a^2$.  So $(a - b)^2= a^2 - b^2$.
If $b =a$ then $(a- b)^2 = (a-a)^2 = 0^2 = 0$. and $a^2 - b^2 = a^2 - b^2 = 0$.  SO $(a- b)^2 = a^2 - b^2$.
That was the easy part.
To prove 2)
$(a-b)^2 = a^2 - b^2$ means
$(a -b)^2 = a^2 -2ab + b^2 = a^2 - b^2$  so
$a^2 - 2ab + b^2 + b^2 = a^2 - b^2 + b^2$ so
$a^2 - 2ab + 2b^2 = a^2$
$a^2 - 2ab + 2b^2- a^2 = a^2 - a^2$
$-2ab + 2b^2 = 0$
$2b(a- b) = 0$
Now if $mn = 0$ either $m = 0$ or $n=0$; that should be a basic fact you know.
So either $2b = 0$ or $a-b = 0$.
If $2b = 0$ then $b = 0$.  If $a-b = 0$ then $a = b$.
So if $(a-b)^2 = a^2 -b^2$ then either $b =0$ or $b= a$.
