Let
x------> gallons of milk containing 7% butterfat
y------> gallons of milk containing 2% butterfat
we know that
x+y=225------> x=225-y------> equation 1
x*0.07+y*0.02=225*0.06------> multiply by 100 both sides
7x+2y=1350------> erquation 2
substitute equation 1 in equation 2
7*[225-y]+2y=1350-----> 1575-7y+2y=1350----> 5y=225-----> y=45 gallons
x=225-y----> x=225-45-----> x=180 gallons
the answer is
180 gallons of milk containing 7% butterfat
45 gallons of milk containing 2% butterfat