Given:
A dairy needs 297 gallons of milk containing 6% butterfat.
To find the total gallons each of milk containing 8% butterfat and milk containing 2% butterfat must be used to obtain the desired 297 gallons:
Let x be the gallons of milk containing 8% butterfat.
So, 297-x be the gallons of milk containing 2% butterfat.
So that,
[tex]\begin{gathered} 0.08x+0.02(297-x)=0.06(297) \\ 0.08x+5.94-0.02x=17.82 \\ 0.06x=11.88 \\ x=198 \end{gathered}[/tex]Since x=198,
297-x=297-198
That is, 99
Hence, 198 gallons of milk containing 8% butterfat and 99 gallons of milk containing 2% butterfat.