Suppose it takes $x$ hours to fill the tank when the drain is closed. Then, the problem says it takes two hours longer to drain the tank. So, that means it takes $x+2$ hours to drain the tank. Let's use an example to help explain how to solve it. Suppose it takes 5 hours to fill the tank (with the drain closed). Then each hour, you can fill $\dfrac{1}{5}$ of the tank. That way, after five hours, you have filled $\dfrac{1}{5}\cdot 5 = 1$ tank. But, we don't know how long it takes to fill the tank. Instead, we say that in one hour, we can fill $\dfrac{1}{x}$ of the tank. Then, in $x$ hours, we can fill 1 tank. Similarly, in one hour, we can drain $\dfrac{1}{x+2}$ of the tank. So, while simultaneously filling and draining the tank, in one hour, we can fill $\dfrac{1}{x} - \dfrac{1}{x+2}$ of the tank. Then, in four hours, we can fill the whole tank, so $4\left( \dfrac{1}{x} - \dfrac{1}{x+2} \right) = 1$. Multiplying both sides by $x(x+2)$ will give a quadratic equation. When you solve for $x$, you will get two values. You know that the correct $x$ value must be between 0 and 4 since it cannot take a negative amount of time to fill the tank, nor can it take more time than it does when the tank is simultaneously draining.