an = a1 + (n-1)d
a4 = a1r = a1 + 3d
a8 = a1r2 = a1 +7d
Multiply the a4 equation by 7 and the a8 equation by 3
7a1r = 7a1 + 21d
3a1r2 =3a1 + 21d
Subtract
a1r(7-3r) = 4a1
and
3r2 - 7r - 4 = 0
(3r-4)(r-1)=0
r=1 is useless as the ratio except in a trivial series where all the terms are the same;
therefore, r=4/3.