Problem 1.
Consider a large mixing tank that initially holds 300 gallons of brine (a mixture of water
and salt). 20 gallons of salt is initially dissolved. Another brine solution is pumped into the tank at a
rate of 3 gallons per minute; the concentration of the salt in this inflow is 2 pounds of salt per
gallon. The brine in the tank is pumped out at the same rate as the entering solution. The solution in
the tank is well stirred. 𝑚(𝑡) denotes the amount of salt in pounds in the tank at time 𝑡 minute.
𝑑𝑚
(i) Formulate an ordinary differential equation for 𝑑𝑡
(the rate of 𝑚(𝑡) change) and find the
particular solution of the initial value problem.
𝑑𝑚 𝑚 gallons
= 2 [gallons⁄gallons] ∙ 3 [gallons⁄min] − ∙ 3 [gallons⁄min]
𝑑𝑡 300 gallons
𝑚
=6−
100
𝑑𝑚 𝑚 600 − 𝑚
=6− =
𝑑𝑡 100 100
1 𝑑𝑚 1
=
600 − 𝑚 𝑑𝑡 100
1 1
𝑑𝑚 = 𝑑𝑡
600 − 𝑚 100
1 1
∫ 𝑑𝑚 = ∫ 𝑑𝑡
600 − 𝑚 100
1
− ln(𝑚 − 600) = 𝑡+𝑐
100
−1
𝑚 = 𝑐1 𝑒 100𝑡 + 600
𝑚(0) = 𝑐1 + 600 = 20 → 𝑐1 = −580
−1
𝑚 = −580𝑒 100𝑡 + 600
(ii) Calculate the amount of salt in the tank at 𝑡 = 2 using the particular solution you found
above.
−1
𝑚(2) = −580𝑒 1002 + 600 = 31.485 gallons
Problem 2. Find the general solution of the following ODE.
𝑦 ′ + 5𝑥𝑦 = 0,
Determine the particular solution of the ODE with the given initial condition of 𝑦(0) = 𝜋.
Solution
The ODE is separable
𝑑𝑦
= −5𝑥𝑦
𝑑𝑥
1
𝑑𝑦 = −5𝑥𝑑𝑥
𝑦
Integrate both sides
5
ln 𝑦 = − 𝑥 2 + 𝑐
2
Some mathematical derivation, the following is the general solution
2
𝑦 = 𝑐𝑒 −2.5𝑥
2
Substitute 𝑦(0) = 𝜋 into 𝑦 = 𝑐𝑒 −2.5𝑥 , then we get:
2
𝜋 = 𝑐𝑒 −2.5(0)
𝑐=𝜋
Problem 3. Find the general solution of the following ODE. Determine the particular solution of the
ODE with the given initial condition 𝑦(0) = 0.25.
𝑦′ = 𝑦 − 𝑦2
Solution
The ODE is separable, we can write the equation as follows
1
𝑑𝑦 = 𝑑𝑥
(𝑦 − 𝑦 2 )
1 1
( + )𝑑𝑦 = 𝑑𝑥
𝑦 1−𝑦
𝑦
ln =𝑥+𝑐
1−𝑦
𝑦
= 𝑐𝑒 𝑥
1−𝑦
𝑦(1 + 𝑐𝑒 𝑥 ) = 𝑐𝑒 𝑥
The general solution is as follows:
1
𝑦=
1 + 𝑐𝑒 −𝑥
1
Substitute 𝑦(0) = 0.25 into 𝑦 = 𝑦 = 1+𝑐𝑒 −𝑥 , then we get:
1
= 0.25
1+𝑐
1+𝑐 =4
𝑐=3
The particular solution is
1
𝑦=
1 + 3𝑒 −𝑥
Problem 4. Solve the following initial value problem.
𝑥𝑦𝑦 ′ + 2𝑥 2 + 𝑦 2 = 0, and 𝑦(2) = −3
Solution
Divide both side by 𝑥𝑦
2𝑥 𝑦
𝑦′ = − −
𝑦 𝑥
𝑦
Introduce 𝑢 = 𝑥
2
𝑦 ′ = − − 𝑢 = 𝑓(𝑢)
𝑢
Put it in the following form
1 1
𝑢′ =
𝑓(𝑢) − 𝑢 𝑥
1 1
𝑢′ =
2 𝑥
− − 2𝑢
𝑢
𝑢 1
2
𝑑𝑢 = 𝑑𝑥
−2 − 2𝑢 𝑥
Integrate both parts
1
− ln(𝑢2 + 1) = ln 𝑥 + 𝑐
4
ln(𝑢2 + 1) = ln(𝑥 −4 𝑐)
𝑢2 + 1 = 𝑐𝑥 −4
𝑦 2 = 𝑐𝑥 −2 − 𝑥 2
Put initial conditions
𝑐
9 = 4 − 4 ➔ 𝑐 = 52
𝑦 = −√52𝑥 −2 − 𝑥 2
Problem 5. Test for exactness of the following differential equation and solve the equation
2 2
2𝑥𝑦𝑒 𝑥 𝑑𝑥 + 𝑒 𝑥 𝑑𝑦 = 0 and 𝑦(0) = 4
Solution
2 2
𝑀 = 2𝑥𝑦𝑒 𝑥 , 𝑁 = 𝑒 𝑥
𝜕𝑀 2 𝜕𝑁
𝜕𝑦
= 2𝑥𝑒 𝑥 = 𝜕𝑥
➔ Exact DE
2 2
𝑓 = ∫ 𝑀 𝑑𝑥 + 𝑔(𝑦) = ∫ 2𝑥𝑦𝑒 𝑥 𝑑𝑥 + 𝑔(𝑦) = 𝑦𝑒 𝑥 + 𝑔(𝑦)
𝜕𝑓 2 2
= 𝑒 𝑥 + 𝑔′ (𝑦) = 𝑁 = 𝑒 𝑥
𝜕𝑦
𝑔′ (𝑦) = 0 → 𝑔(𝑦) = 𝑐 (where c is a constant)
2 2
𝑦𝑒 𝑥 + 𝑐 = constant → 𝑦𝑒 𝑥 = 𝑐
Put initial condition, we can get c
4∗1=𝑐
The final result is
2
𝑦𝑒 𝑥 = 4
4
𝑦= 2
𝑒𝑥
Problem 6. Find the general solution of the following ODE.
(𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 )𝑑𝑥 + (𝑥𝑒 𝑦 − 1)𝑑𝑦 = 0
The ODE is not exact, but there is an integrating factor, 𝑓(𝑦) = 𝑒 −𝑦 .
Solution
𝑀 = 𝑃 = (𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 ) and 𝑁 = 𝑄 = (𝑥𝑒 𝑦 − 1)
𝜕𝑀 𝜕𝑁
𝜕𝑦
= 𝑒 𝑥+𝑦 + 𝑒 𝑦 + 𝑦𝑒 𝑦 and 𝜕𝑥 = 𝑒 𝑦 ➔ Not exact DE
The integrating factor is
𝑓(𝑦) = 𝑒 −𝑦
Convert to exact DE
𝑀 = 𝑒𝑥 + 𝑦
𝑁 = 𝑥 − 𝑒 −𝑦
∫(𝑒 𝑥 + 𝑦) 𝑑𝑥 + 𝑔(𝑦) = 𝑒 𝑥 + 𝑥𝑦 + 𝑔(𝑦) = constant
𝜕𝑢
𝜕𝑦
= 𝑥 + 𝑔′ (𝑦) = 𝑥 − 𝑒 −𝑦 → 𝑔′ (𝑦) = −𝑒 −𝑦 → 𝑔(𝑦) = 𝑒 −𝑦 + 𝑐
𝑒 𝑥 + 𝑥𝑦 + 𝑒 −𝑦 + 𝑐 = constant → 𝑒 𝑥 + 𝑥𝑦 + 𝑒 −𝑦 = 𝑐
𝑒 𝑥 + 𝑥𝑦 + 𝑒 −𝑦 = 𝑐
Problem 7. Find an integrating factor for this non-exact equation
𝑥𝑦 2 𝑑𝑥 + 𝑥𝑦 𝑑𝑦 = 0
Solution:
𝑀 = 𝑥𝑦 2 and 𝑁 = 𝑥𝑦
𝜕𝑀 𝜕𝑁
𝜕𝑦
= 2𝑥𝑦 and 𝜕𝑥 = 𝑦 → the equation is not exact.
Because only involves x, we can find an integrating factor f(x):
.
Then, multiplying by the integrating factor, we obtain
𝑦 2 𝑒 2𝑥 𝑑𝑥 + 𝑦𝑒 2𝑥 𝑑𝑦 = 0.
𝑀 = 𝑦 2 𝑒 2𝑥 and 𝑁 = 𝑦𝑒 2𝑥
𝜕𝑀 𝜕𝑁
𝜕𝑦
= 2𝑒 2𝑥 𝑦 and 𝜕𝑥 = 2𝑒 2𝑥 𝑦 → the new equation is exact.