their sum can be written as : a+b=20. this means that b=20-a
and the phrase: The difference between three times the first number and twice the second is 40 like this:
3a-2b=40
and we can substitute:
3a-2b=40
3a-2(20-a)=40
3a-40+2a=40
5a=40+40
5a=80
a=16
so b must be 4!
let's check:
3*16-2*4=48-8=40 correct!