Call x the volume of gas whose octane rating is 140 and y the volume of gas whose octane rating is 80, then:
(1) x*140 + y*80 = 60*120, and
(2) x + y = 60
from (1) 140x + 80y = 7200 => (3) 7x + 4y = 360
from (2) ---> (4) 4x + 4y = 240
Subtract (4) from (3)
7x - 4x = 360 - 240
3x = 120
=> x = 120/3 = 40
=> y = 120 - 40 = 80
Answer: should be used 80 gallons from tank with the octane rating of 80