A term in an arithmetic progression is given by the formula a1 + (n-1) d
Thus; a8 = a1 + 7d =40
a13 = a1 + 12 d = -10
Solving them simultaneously;
a1 +7d =40
a1 + 12d = -10 subtracting the two equations
-5d =50
d = -10
a1 = 40 - (7Ă— -10)
= 110
Therefore; a1 = 110 and d = -10