Unique solution:
x + by = -1 .... (1)
ax + 2y = 5 .... (2)
Solve using the elimination method:
Multiply equation (1) by a, subtract it from equation (2) and then solve for y:
y = 5 + a \Rightarrow y = \frac{5 + a}{2 - ab})
.
Note that this solution is OK
provided the denominator is NOT equal to zero, that is,

.
Now sub

into either equation and solve for x. Using equation (1):
}{2 - ab} - \frac{b(5 + a)}{2 - ab} = \frac{-2 + ab - 5b - ab}{2 - ab} = \frac{-2 - 5b}{2 - ab})
.
So there's a unique solution, given by the above, when

.
--------------------------------------------------------------------------
No unique solution:
.
When there's no unique solution, that means that either there is an infinite number of solutions or no solution at all. To test which of these happens when ab = 2, you might do something like the following:

. Substitute this into you equations and do some re-arranging:
Equation (1):

.
Equation (2):

.
Now compare equations (1) and (2). You can see that when

the equations are the same. One equation and two unknowns => infinite number of solutions.
So when ab = 2 AND a = -5, there an infinite number of solutions.
It follows that there will be no solution at all when ab = 2 AND

.
When a = -5 and ab = 2,

. So the equations boil down to -5x + 2y = 5. The form of the infinite number of solutions can be expressed in several ways. To see where the books answer came from, note that if you let y = t, where t can be any real number:

.