# 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. Sep 17, 2014 at 19:58
• @user164587 Yes but how do you go about solving this. I just plugged in numbers.
– col
Sep 17, 2014 at 20:15
• See this related question. Sep 17, 2014 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}$$

• But doesn't this ignore $\begin{array}{c|c} (a-b)&(a+b)&a&b\\\hline 8&2&5&-3\\ 16&1&8.5&-7.5\\ -16&-1&-8.5&7.5\\ -8&-2&-5&3 \end{array}$? Point being if we don't eliminate redundant similar cases we must consider all possible $10$ cases. (Noting $r^2-k^2 = (\pm r)^2-(\pm k)^2$ we can reduce this to $|a|-|b|, |a|+|b|$ and noting $|a|-|b|< |a|+|b|$ the reduces to only three cases. (and noting $|a|+|b|=(|a|-|b|)+2|b|$ must both be even or both odd we reduce to only two.. the considering $a=\pm|a|$ and $b=\pm|b|$ we get all 6 cases. Jul 16, 2022 at 18:06

$(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.