There are 20 gallons of 20% butterbeer solution.
Assume there are x gallons of 80% solution.
So total amount of the solution will be (x+20) gallons
The final solution is 50%.
So, we can set up the equation as:
[tex]0.2(20)+0.8(x)=0.5(x+20) \\ \\ 4+0.8x=0.5x+10 \\ \\ 0.8x-0.5x=10-4 \\ \\ 0.3x=6 x=20 [/tex].
Thus, there will be 20 gallons of 80% butterbeer solution that is needed to be mixed with 20 gallons of 20% butterbeer solution.