Convert all of your %'s into decimals by dividing by 100.
The total amount of butterfat needed is 0.04 times 235 or 9.4 gallons of butterfat
Let X be the number of gallons of the 6% butterfat milk.
Then 235 - X is the gallons of 1% butterfat milk used.
Then 0.06 times X + 0.01 times( 235 - X) = 9.4
Multiply through: 0.06 X + 2.35 - 0.01 X = 9.4
Combine terms: 0.05 x + 2.35 = 9.4
Subtract 2.35 from both sides: 0.05X = 7.05
Divide by 0.05: X = 141
Thus 141 gallons of 6% and 235 - 141 or 94 gallons of 1%.
For 3% the calculations are likewise as the total butterfat = 235 times 0.03 = 7.05 gallons of butterfat.
Use the same equation and logic as above with 7.05 replacing 9.4.
Then 0.06 times X + 0.01 times( 235 - X) = 7.05
Multiply through: 0.06 X + 2.35 - 0.01 X = 7.05
Subtract 2.35 from both sides: 0.05X = 4.7
Divide by 0.05: X = 94
Thus 94 gallons of 6% and 235 - 94 or 141 gallons of 1%.