Some basics about differential equations: when we solve a linear differential equation with a first derivative, we always get one arbitrary constant to be determined. For example: $y' = 1$ means that $y = x + C$. That constant will be determined by some conditions that are given to you, usually initial conditions (in this case, like the amount of chemical present before the mixing). So you can set up the differential equation and solve it, but you won't get the full answer. (You still get a lot of information, though.)
The problem should be tackled like this:
$$\frac{\mathrm{d}q}{\mathrm{d}t} = \text{rate of inflow} - \text{rate of outflow}$$
Calculate flows by multiplying the rate of flow of water with how much chemical there is per gallon. Inflow is easy. Outflow is too, if you realize that the amount of chemical, q, is spread out over the full volume of water.