a+b=18
2a+3b=40
Here's two solutions:
A) Multiply the first equation by (-2) & sum then the two equations, resulting ''b''. Or, multiply that first equation by (-3) Summing them you get ''a''. Whatever you obtain, introduce it into an equation and obtain the other one.
B) You have a system of two equation with two unknown terms. Get one unknown term (e.g. ''a'') out of the first equation (a=18-b) & introduce it (18-b) into the other equation, the second one, instead of that unknown term, and you'll get this second equation written within just one unknown term ( 2(18-b)+3b=40 ; 36-2b+3b=40. With the term this way defined, you'll have also the first one.
x+y=18; 2x+3y=40
y=18-x, 2x+3(18-x)=40
2x+54-3x=40
-x=-14
x=14
14+y=18, y=4
14+4=18
2(14)+3(4)=40, 28+12=40