In geometric progression sum of 2nd term and 3rd term is 12 and sum of 4th term and 5th term is 300 find first term and common ratio

MATHEMATICS

a r + a r^2 = 12 ... a r (1 + r) = 12

a r^3 + a r^4 = 300 ... a r^3 (1 + r) = 300

dividing equations ... r^2 = 25 ... r = 5

substitute back to find a

ar +ar^2 = 12 ---> ar(1+r) = 12

ar^3 + ar^4 = 300 --> ar^3(1+r) = 300

divide the 2nd equation by the first:
r^2 = 300/12 = 25
r = ± 5
sub into ar(1+r) = 12
if r = 5, 5a(6) = 12 ----> a = 2/5
if r = -5, -5a(-4) = 12 ----> a = 3/5

check:
case 1: a = 2/5, r = 5, we have 2/5, 2, 10, 50, 250, ...
sum of 2nd and 3rd = 12, sum of 4th and 5th = 300, check!

case 2. a = 3/5, r = -5, we have 3/5, -3, 15, -75, 375
sum of 2nd and 3rd = -3+15 = 12, sum of 4th and 5th = -75+375 = 300,

my answers are correct