The line 
 is in intercept form with x-intercept (a,0) and 
y-intercept (0,b). So the midpoint of AB is 
 = 
.
Since it lies on the line 
, 
,
Since the distance AB = 10
a+2=0;  a-20=0
  a=-2;    a=20
, 
,     
,       
So at first, there seem to be two answers. The first one
a=-2, b=24
with A=(a,0)=(-2,0), B=(0,24) 
and midpoint M of AB = 
 = 
 = (-1,12)
Here is solution with a=-2, b=24. The green line is 2x + y = 10.
 
However what seemed like another solution
a=20, b=0
turned out to be extraneous because when we substitute a=20, b=0
in 
, we get
We have an undefined term in the equation, since division by 0 is
not permitted.
If the equation had first been multiplied through by ab so that we
would have had 
 then we may have had a second solution, 
but since it was given as 
, the "second solution" 
was extraneous.  So there is just one solution a=-2, b=24.
Edwin