2. The barrel is filled with 100% alcohol. From the barrel, two liters of alcohol are removed and the same amount of distilled water is added. The procedure is repeated once more, i.e., two liters of the solution are removed and two liters of distilled water are added. In this way, the barrel contains 36% alcohol. How many liters of solution does the barrel contain?
Solution. Let there be $x$ liters of alcohol in the barrel at the beginning, which is also the total amount of solution in the barrel. When we pour out 2 liters of alcohol and add 2 liters of water, there will be $x-2$ liters of pure alcohol in the barrel, which is $\frac{100(x-2)}{x}$ percent alcohol. The total amount of pure alcohol after the second transfer is $x-2-2 \cdot \frac{x-2}{x}$ liters, and according to the condition of the problem, this is $0.36 x$. Thus, we get the equation

$$
x-2-2 \cdot \frac{x-2}{x}=0.36 x
$$

After multiplying by $x$, we get

$$
\begin{aligned}
& x^{2}-2 x-2 \cdot(x-2)=0.36 x^{2} \\
& x(x-2)-2(x-2)=0.36 x^{2} \\
& (x-2)^{2}=(0.6 x)^{2}
\end{aligned}
$$

We are working with positive quantities, so we have

$$
\begin{aligned}
& x-2=0.6 x \\
& 0.4 x=2 \\
& x=5
\end{aligned}
$$

Thus, the barrel contains 5 liters of solution.