A 100-gallon tank intiially contains 100 gallons of sugar water at a concentration of .25lbs of sugar/gallon. A 100-gallon tank initially contains 100 gallons of sugar water at a concentration of .25lbs of sugar/gallon. 
Suppose that sugar is added to the tank at a rate of p pounds/min. Suppose that sugar water is removed at a rate of 1gallon/min and that the water in the tank is well mixed. 
What value of P should we pick so that  that when 5 gallons of sugar solution is left in the tank the concentration is .5lbs of sugar/gallon?
I have that S(t)=k(100-t)-P(ln(100-t)(100-t))
So when t=0, I have 100k-100Pln(100)=25 and
   when t=95, I have 5k-5Pln(5)=2.5
I have tried solving this system of equation but even my ODE mind cannot wrap around the solution. I have that P= 1/(4ln20), am I on the right path?
 A: Notice, 
Initially the volume of the sugar water solution $$V_1=100\ gallons$$ 
Initially the mass (amount) of the sugar in the solution $$\color{red}{m_1}=\text{(volume of solution)}\times\text{(concentration of sugar)}$$$$=100\times 0.25=\color{red}{25\ lbs}$$
after $t$ minutes,  
the volume of the sugar water solution left after $t$ minutes $$V_2=\text{(initial volume of solution)}-\text{(solution removal rate)}\times\text{(time)}$$   $$V_2=V_1-1\times t$$ substituting the corresponding values, we get $$5=100-t\implies t=100-5=95\ minutes$$
the mass (amount) of the sugar left after $t=95$ minutes $$m_2=\text{(volume of sugar solution left over)}-\text{(concentration of sugar left over)}\times\text{(time)}$$   $$\color{red}{m_2}=5\times 0.5=\color{red}{2.5\ lbs}$$ 
Hence, the constant rate of adding the sugar in the solution $$=\frac{\text{(initial mass of sugar)}-\text{(mass of sugar left over)}}{\text{time required}}$$
$$P=\frac{m_1-m_2}{t}$$  $$\color{red}{P}=\frac{25-2.5}{95}=\color{red}{\frac{9}{38}\approx 0.2368\ lbs/minute}$$
A: Hint: find an expression for the concentration when there are 5 gallons left in terms of $P$. That is, the concentration after 95 minutes. 

 After 95 minutes there are $.25 \cdot 5 + P \cdot 95$ pounds of sugar. 

Now find the value of $P$ that will result in there being $.5$ concentration in those $5$ gallons, i.e. so there will be 2.5 pounds of sugar.
