finding integer solutions for a and b

Show that the only positive integer solutions for $a$ and $b$ in the equation $a^2-b^2=16$ are $a=4, b=0$ and $a=5, b=3.$ How many pairs of solutions would there be if we allowed negative values for the variables as well?

I know that $a^2-b^2=16=(a+b)(a-b)=16.$ I also know that the solutions are $(4,0)$ and $(5,3)$ because I plugged them in to find a solution. I just forgot how do you solve something like this. Can someone please show me? I suppose it is the samething with the negative values?

• The negative values question should be fairly obvious since all variables in the equation are squared. Thus $\{(\pm4, 0), (\pm5,\pm3)\}$ is the solution set. – user164587 Sep 17 '14 at 19:58
• @user164587 Yes but how do you go about solving this. I just plugged in numbers. – col Sep 17 '14 at 20:15
• See this related question. – JimmyK4542 Sep 17 '14 at 20:54

$a^2-b^2=(a-b)(a+b)=16$ $$\begin{array}{c|c} (a-b)&(a+b)&a&b\\\hline 1&16&8.5&7.5\\ 2&8&5&3\\ 4&4&4&0\\ -1&-16&-8.5&-7.5\\ -2&-8&-5&-3\\ -4&-4&-4&0 \end{array}$$

$(a-b)(a+b) = 16$

$(a-b) = \frac{16}{(a+b)}$

$a = \frac{16}{(a+b)} + b$

$a = \frac{16}{(a+b)} + \frac{b(a+b)}{(a+b)}$

$a = \frac{16}{(a+b)} + \frac{ab+b^2}{(a+b)}$

$a = \frac{(16 + ab + b^2)}{(a+b)}$

$a(a+b) = 16 + ab + b^2$

$a^2 + ab - ab = 16 + ab + b^2 - ab$

$a^2 = 16 + b^2$

$a = \frac{+}{-} \sqrt{16 + b^2}$

Every negative solution of $a$ and $b$ should also have a positive solution of $a$ and $b$ since they are squared. It does not matter if $a$ is positive or negative or if $b$ is positive or negative.