Total: 15 gallons
Let x be the fuel with 15% ethanol and y be the one wit 65% ethanol
x+y = 15
0.15x+0.65y=0.4*15 = 6
So, let's isolate x in the first equation:
x=15-y
And substitute on the second:
0.15(15-y) +0.85y=6
2.25y+0.65y = 6
2,9y=6
y=2.06 gallons
x= 12.94 gallons
I should use 2.06 gallons of 65% ethanol.