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.