Separable Equations

A first order differential equation \( y' = f(x,y) \) is called separable if its slope function is the product of two functions, each depending on one variable: \[ y' (x) = p(x)\,q(y) . \]
A more general differential form is
\[ M(x)\,{\text d}x + N(y)\,{\text d}y =0 , \] where \( M(x) \ \mbox{and} \ N(y) \) are some integrable functions in some domain of interest. A separable equation can always be solved by integration. We illustrate the process by examples.

Example 1. At time t=0 a tank contains \( Q_0 \) of salt dissolved in 200 liters of water. Assuming that water containing (1/8) kg of salt/ liter is entering the tank at a rate of r kg per liter and that the well-stirred mixture is draining from the tank at the same rate. The initial value problem that describes ths=is process can be expressed as
\[ \frac{{\text d}Q}{{\text d}t} = \frac{r}{8} - \frac{r\,Q}{200} , \qquad Q(0) = Q_0 . \]
The rate at which salt enters the tank is the concentration (1/8) kg/liter times the flow rate r liter/min or (r/8) kg/min.

To solve the equation, we separate the variables
\[ \frac{{\text d}Q}{25 -Q} = r\,\frac{{\text d}t}{200} \] Upon integration, we get \[ - \ln (25- Q) = \int \frac{{\text d}Q}{25 -Q} = r\,\int \frac{{\text d}t}{200} = \frac{r\,t}{200} -C, \] where C is a constant of integration. To satisfy the initial condition Q(0) = Qo, we must choose the value of constant C accordingly, and obtain the solution \[ Q(t) = 25 + \left( Q_0 - 25 \right) e^{-rt/200} \]
To obtain this solution, we type in MuPAD:
diff_eq = (r/8) - (r*Q/200)

Setting the rate (r) =8 kg/min and solving the differential equation where Qo is the initial amount of salt in the tank, we get
r:=8: ivp:= ode({Q'(t)=(r/8) - (r/200)*Q(t), Q(0) = Qo}, Q(t))

solve(ivp)

Solution to the differential equation with several values for Qo
Q:= 25 + (0 - 25)*exp(-r*t/200):
Q1:= 25 + (5 - 25)*exp(-r*t/200):
Q2:= 25 + (10 - 25)*exp(-r*t/200):
Q3:= 25 + (15 - 25)*exp(-r*t/200):
Q4:= 25 + (20 - 25)*exp(-r*t/200):
Q5:= 25 + (25 - 25)*exp(-r*t/200):
Q6:= 25 + (30 - 25)*exp(-r*t/200):
Q7:= 25 + (35 - 25)*exp(-r*t/200):
Q8:= 25 + (40 - 25)*exp(-r*t/200):
Q9:= 25 + (45 - 25)*exp(-r*t/200):
Q10:= 25 + (50 - 25)*exp(-r*t/200):
plot(Q,Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10, t= 0..100)

No matter what the initial amount of salt in the tank is, as time continues the amount of salt in the tank approaches 25 liters. Thus the limiting amount (QL) is 25 liters.
If Qo = 3QL (thus Qo = 75), to figure out the time (t) that the salt level is within 2% of QL (2% of QL is 0.5) we solve the follwing equation
solve(25.5 = 25 + (75-25)*exp(-t/25), t, Real)

115.1292546

Thus the time required for the salt level to be within 2% of QL is 115.12 minutes.
To find the rate that is required for the time (t) to not exceed 45 minutes, we set (t) equal to 45 minutes and solve for rate.
solve(25.5 = 25 + (75-25)*exp(-rate*45/100), rate, Real)
{10.23371152}

Thus the required rate is 10.23 kg/min.

Example 2. Suppose that a sum of money is deposited in a bank or money fund that pays interest at an annual rate r. The value S(t) of the investment at any time t depends on the frequency with which interest is compounded as well as on the interst rate. Financial instititions have various policies concerning compounding: some compound monthly, some weekly, some even daily. If we assume that compounding takes place continuously, then we can set up an initial value problem that describes the growth of the investment.

The rate of change of the value of the investment is \( {\text d}S/{\text d}t, \) and this quantity is equal to the rate at which interest accrues, which is the interest rate r times the current value of the investment \( S(t). \) Thus,

\[ {\text d}S/{\text d}t = r\,S \] is the differential equation that governs the process. Suppose that we also know the value of the initial investment, say, \[ S(0) = S_0 . \] Then the solution of this initial value problem gives the balance S(t) in the amount at any time t.

 

We assume that the rate of change of the value of the investment after a time period is
diff_(eq2) = ri*s + k

where ri is the rate of interest, s is the current amount of the investment and k is the deposite/withdrawal rate.
Solving the differential equation
ivp2:= ode({S'(t)=ri*S(t) + k, S(0)=So}, S(t))

Out= ode({S(0) = S0, S'(t) -ri S(t) -k}, S(t))

S:= solve(ivp2)

Assuming that So = 0, ri = 0.06, and k = 3000, the model for the amount of money accumlated over 50 years is represented below:
So:=0: ri:=0.06: k:=3000: plot(S[2], x=0..50)

As the time continues, the a

 

Example 3. Consider a pond that initially contains 8*10^6 million liters of fresh water. Water containing an undesirable chemical flows into the pond at the rate of

The rate of chemical flowing in and out of the pond is 8*10^6 gal/year. The amount of chemical flowing into the pond is the rate of chemical flowing in times the amount (3 + sin3t) g/gal. Thus the amount of chemical in the pond with respect to time is the difference between the amount of chemical flowing into the pond and the amount of chemical flowing out of the pond. The differential equation can be modeled as
diff_eq3 = (8*10^6)*(3 + sin(3*t)) - 4*C/5

C is the amount of chemical in the pond.
Solving the differential equation
ivp3:= ode({C'(t)=(8*10^6)*(3+sin(3*t)) - 4*C(t)/5, C(0)=0},
C(t)) C:=solve(ivp3)
plot(C, t=0..25)

At 3*10^7 grams or 30 mg the plot of the solution oscillates. Thus 30 mg is the equilbrium solution.

 

Example 4. A body of constant mass m is projected away from the earth in a direction perpendicular to the earth's surface with an initial velocity \( v_0. \) Assuming that there is no air resistance, but taking into account teh variation of teh earth's gravitational field with distance,

Plotting multiple functions in MuPAD is quite easy. We can use something called a canvas to accumulate several plots into a single image that you can export by right-clicking on the plot. In the following example, we will plot 4 trigonometric functions.

The only force acting on the object is force of gravity. Thus, \( ma = -mg = m({\text d}v/{\text d}t) = -mgR^2/(R+x)^2 \) . Here m is the mass of the equation cancels out, R is the radius of the earth, g is the acceleration due to gravity, and x is the distance from the earth's surface. Using the chain rule to express dv/dt in terms of x, the differenetial equation can be modeled as
diff_eq4 = -g*R^2/(V*(R+x)^2)

Solving the differential equation for V (velocity)
ivp4:= ode({V'(x) = -g*R^2/(V(x)*(R+x)^2), V(0)=vo}, V(x))
f:= solve(ivp4)

vo:=8: g:=0.006108079: R:=3949:
vo represents the intial velocity of an object in miles/second,
g is the acceleration due to gravity in mi/s^2,
R is the radius of the earth in miles
x is the distance from the surface of the earth in miles

When the object is rising above the earth's surface the velocity is:
Vr:=f[2]

plot(Vr, x=0..20000)

As the object rises away from the surface of the earth, its velocity begins to slow. This is expected because the velocity of the object is inversely related to the distance the object is from the earth's surface.

When the object is falling back to earth the velocity is:
Vf:= -Vr
plot(Vf, x=0..20000)

 

To solve for the maximum altitude that the object reaches, we set Vf = 0 and solve xmax
xmax:= abs(solve(0=(sqrt(2)*sqrt(vo^2/2 - R*g + R^2*g/(R+x))), x))

{16038.18455}

Thus the maximum altitude that the object reaches is 16038.18 miles. To solve the initial velocity at xmax, we solve for vo.
v = sqrt(2*g*R*xmax/(R+xmax))

v = {6.221751762}

Thus the initial velocity requried to get the object to xmax is 6.22 mi/s.
To calculate the escape velocity we let xmax approach infinity.
ve = sqrt(2*g*R)

ve = 6.945617895

Thus the escape velocity is 6.9 mi/s.