This is a pretty standard "mixing problem." You went wrong in a couple of places:
- Your set-up for $S'(t)$ has a wrong sign. (This get spontaneously "fixed" later on, which suggests and error in copying somewhere).
- But more seriously: Your integrating factor is incorrect.
You start pretty well: if we let $S(t)$ be the amount of salt (in grams) in the tank at time $t$ ($t$ measured in minutes). (Note, $S(t)$ is the amount, not the concentration; your formulas clearly view $S$ as the amount, not the concentration; see Pickahu's set-up if you want to use the concentration instead).
In these problems, the amount of salt at any given time is changing by the formula
$$\frac{dS}{dt} = \binom{\text{rate}}{\text{in}} - \binom{\text{rate}}{\text{out}}.$$
And the initial condition $S(0)$ depends on the problem.
The initial condition is simple enough: you are told there are 250 liters of water, with a salt concentration of 7 grams per liter. So
$$S(0) = \left(250\ \text{liters}\right)\left(7\ \frac{\text{grams}}{\text{liter}}\right) = 1750\ \text{grams of salt.}$$
What about the rates in and out? We are adding 9 liters per minute, each liter containing 3 grams of salt. That is, the rate in is:
$$\text{rate in} = \left(3\frac{\text{grams}}{\text{liter}}\right)\left(9\frac{\text{liters}}{\text{minute}}\right) = 27\frac{\text{grams}}{\text{minute}};$$
What is the rate out? We are letting out 5 liters per minute; each liter will have as much salt as the concentration at time $t$. The concentration at time $t$ is given by the amount of salt at time $t$, which is $S(t)$, divided by the amount of liquid at time $t$.
From the moment we start with $250$ liters, each minute you add $9$ liters and you drain $5$ liters, for a net total addition of $4$ liters per minute. So at time $t$, the total amount of liquid in the tank is $250+4t$. So the concentration of salt at time $t$ is
$$\frac{S(t)}{250+4t}\ \frac{\text{grams}}{\text{liter}}.$$
Since we are draining five liters at this concentration, we have that
$$\text{rate out} = \left(5\ \frac{\text{liters}}{\text{minute}}\right)\left(\frac{S(t)}{250+4t}\ \frac{\text{grams}}{\text{liter}}\right) = \frac{5S(t)}{250+4t}\ \frac{\text{grams}}{\text{minute}}.$$
So the differential equation we need to solve is:
$$\frac{dS}{dt} = 27 - \frac{5S}{250+4t}.$$
Writing this in the standard form, we have
$$S' + \frac{5}{250+4t}S = 27.$$
We need an integrating factor. Letting $\mu(t)$ stand for this factor, multiplying through we have
$$\mu(t)S' + \frac{5\mu(t)}{250+4t}S = 27\mu(t)$$
and we want to realize the left hand side as the derivative of a product; that is, we want
$$\mu'(t) = \frac{5\mu(t)}{250+4t}.$$
Separating variables we have
$$\begin{align*}
\frac{\mu'(t)}{\mu(t)} &= \frac{5}{250+4t}\\
\int\frac{d\mu}{\mu} &= \int \frac{5\,dt}{250+4t}\\
\ln|\mu| &= \frac{5}{4}\ln|250+4t| + C\\
\mu(t) &= A(250+4t)^{5/4}
\end{align*}$$
Picking $A=1$, we can take $\mu(t) = (250+4t)^{5/4}$. (Another error in your computation).
That is, we have:
$$(250+4t)^{5/4}S' + \frac{5(250+4t)^{5/4}}{250+4t}S = 27(250+4t)^{5/4}$$
or
$$(250+4t)^{5/4}S' + 5(250+4t)^{1/4}S = 27(250+4t)^{5/4}$$
which can be written as
$$\Bigl( (250+4t)^{5/4}S\Bigr)' = 27(250+4t)^{5/4}.$$
You might benefit from writing out the derivations very carefully (as I did above) rather than trying to rely on formulas (I assume that's how you tried to obtain your integrating factor $I$, which was mistakenly computed).
Can you take it from here? Careful with the integral on the right hand side.
I misread the question and misinterpreted the amount of incoming salt.
There are 3 pounds per gallon of incoming brine, and 4 gallons being pumped in per minute, in other words, 12 pounds incoming.
If $A(t)$ is the function describing the total amount of salt as a function of time, then $$\frac{dA}{dt} = 12 - \frac{5A(t)}{100-t}.$$
Solving the differential equation gave me $$A(t) = [3(100-t)^{-4}+C](100-t)^5 $$ and then I solved for C by using $A(0) = 0$ as an initial condition (since the tank has no brine at the beginning). My final function for $$A(t)= 3(100-t)-\frac{3}{100^4}(100-t)^5$$ and $$A(30) = 159.57$$
:)
Best Answer
The amount of liquid in the tank at time $t$ is $4000-60t$. (We are using $t=0$ for the time the process begins.) This is because liquid is entering at $40$ litres per second and leaving at $100$ litres per second.
If $y$ is the amount of chlorine in the tank at time $t$, then the concentration of chlorine at time $t$ is $\frac{y}{4000-60t}$ grams per litre.
Since liquid is leaving the tank at $100$ litres per second, the rate at which chlorine is leaving at time $t$ is $\frac{100y}{4000-60t}$ (grams per second).
We thus obtain the differential equation $$\frac{dy}{dt}=-\frac{100y}{4000-60t}.$$ This is a separable DE. Use standard techniques to find the solution. The initial condition is $y(0)=(4000)(0.005)$.
Added: the calculation
The DE can be rewritten as $$\frac{dy}{y}=-\frac{5\,dt}{200-3t}.$$ Integrate. We get $$\ln|y|=\frac{5}{3}\ln(|200-3t|)+C.$$ Exponentiate. We get $$y=K(200-3t)^{5/3}.$$ Using the initial condition $y(0)=20$, we get $$y=20(200)^{-5/3}(200-3t)^{5/3}.$$ This looks much more attractive as $$y=20\left(1-\frac{3t}{200} \right)^{5/3}.$$
Remark: The differential equation has a limited range of validity, since pretty soon the tank will be empty.