##S_40 = 3220##

Use the sum formula :

##S_n = n/2 [ 2a + (n-1)d]##

and the ##n##-th term

##T_n = A +(n-1) d##

to solve for ##a## and ##d##.

This will get you

##S_12 = 186## and ##T_20 = 83##.

The equations are

##i) 12/2 [ 2a +11d ] = 186##

and

##ii) a + 19d = 83##

Solve like a linear system :

##{(12a + 66d = 186) (a + 19d = 83) :}##

##a = 83 – 19d##

sub in ##i)##

##12 (83 – 19d ) + 66d = 186##

##996 – 228d + 66d = 186##

##162 d = – 810##

##d = -5##

This means that

##a + 19 ( -5 ) = 83##

##a -95 = 83##

##a = 178##

Now

##S_40 = 20 [ 2(178) + 39 ( -5) ]##

## S_40 = 20 [ 356 – 195 ]##

##S_40 = 3220##