Solve $ax - a^2 = bx - b^2$ for $x$ Method 1
Solve for x
$$ax - a^2 = bx - b^2$$  
Collect all terms with x on one side of the equation
$$ax - bx = a^2 -b^2$$
Factor both sides of the equation
$$(a -b)x = (a+b)(a - b)$$
Divide both sides of the equation by the coefficient of $x$  (which is $a-b$)
$$x = a + b$$     (where $a \neq b$ since this would mean dividing by $0$)
Method 2
Solve for $x$
$$ax - a^2= bx - b^2$$  
Bring all the terms to one side of the equation
$$ax - a^2 -bx + b^2 = 0$$
Rearrange
$$ax - bx -(a^2-b^2)=0$$
Factor
$$(a - b)x - (a + b)(a - b) = 0$$
$$(a - b)( x - (a + b)) = 0$$
which is a true statement if $$a-b=0$$ $$a = b$$ or $$x-(a+b)=0$$ $$x = a + b$$
My question is I don't understand how this second method is consistent with the first in terms of the restriction on $a$ and $b$.

In the first method you come to the equation
$$(a-b)x=(a+b)(a-b)$$
In the second method, you come to the equation
$$(a-b)(x-(a+b))=0$$
which is just the first equation rearranged and factored.  If we divide the first equation by $(a-b)$ without factoring, we still collect the solution $a=b$, because notice that it does solve the first equation.  However, we continue on assuming $a\ne b$ to discover the other solution.
The method is the same with the second equation.  We first collect the solution $a=b$, and then we assume $a\ne b$ to see if there are other solutions.  By the zero product property, it follows that we must have $x=a+b$.
