I need explanation for this solution for the proof. (Perfect square ends with 0,1,4,5,6,9) Give a proof to the sentence: "The final decimal digit of a perfect square is 0, 1, 4, 5, 6 or 9."
Solution:
A integer $n$ can be expressed as $10a+b$, where $a$ and $b$ are positive integers and $b$ is 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.
Here $a$ is the integer obtained by subtracting the final decimal digit of $n$ and dividing by 10. (so $a=(n-b)/10$)
Next note that $(10a + b)^2 = 100a^2+20ab+b^2=10(10a^2+2b)+b^2$ so the final decimal digit of $n^2$ is same as the final decimal digit of $b^2$.
I understand until this point but not below:
Furthermore, note that the final decimal digit of $b^2$ is the same as final decimal digit of $(10-b)^2 = 100 - 20ab + b^2$. (how did you get this equation?) consequently we cab reduce our proof to the consideration of fix cases.
final digit of:
1) $n$ is 1 or 9 is 1
2) $n$ is 2 o 8 is 4
3) $n$ is 3 or 7 is 9
4) $n$ is 4 or 6 is 6
5) $n$ is 5 is 5
6) $n$ is 0 is 0
THANKS!

Well, it should say "note that the final decimal digit of $b^{2}$ is the same as the final decimal digit of $(10-b)^{2} = 100-20b+b^{2}$." Since $100-20b+b^{2}=10(10-2b)+b^{2}$, the only number affecting the units digit of $(10-b)^{2}$ is $b^{2}$. Thus, the units digit of $b^{2}$ is the same as the units digit of $(10-b)^{2}$.
Note that this whole part of the proof is completely unnecessary. They already showed that since any integer can be written in the form $10a+b$ and since $$(10a+b)^{2}=100a^{2}+20ab+b^{2}=10(10a^{2}+2ab)+b^{2}$$ the only part that matters in determining the units digit is $b^{2}$. From here, you could simply check all integer values of $b$ from 0 to 9, but they instead slightly simplified the number of cases needed by showing that $b^{2}$ and $(10-b)^{2}$ have the same units digit.
