A separable equation \( y' = f(x,y) \) is such differential equation for which the slope function is a product of two
functions depending on only one variable: \( f(x,y) = p(x)\,q(y) . \) Every separable equation can be integrated. Gottfried Leibniz discovered the separable equations in 1691; he also proposed the method for their solutions.
Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the course APMA0330
Return to the main page for the course APMA0340
Return to Part II of the course APMA0330
A differential equation \( y' = f(x,y) \) is said to be separable if the slope function is the product of two functions depending on only one variable: \( f(x,y) = p(x) q(y). \) Then rewriting the derivative y' in differential form \( y' = {\text d}y / {\text d}x , \) we separate variables:
each part can be integrated. In other words, a separable differential equation is a differential equation in which the two variables can be placed on opposite sides of the equals sign such that the dx and x terms are on one side and the dy and the y terms are on the other. The dx and dy terms need to be multiplied by the x and y terms, respectively. Note that since we divide by q, we need to exclude from our further consideration the stationary points that are the roots of \( q(y) =0 ; \) they could be either singular or not.
We show how to solve separable differential equations in the following examples.
Example 1:
Consider the separable differential equation with polynomial slope:
where C is a constant of integration. This gives us the general solution in implicit form:
\[
2 = y \left( C - x^2 \right).
\]
As we see from the phase portrait, the trivial solution y ≡ 0 can be obtained by choosing the arbitrary constant to be infinity. It is a separatrix that can be obtained by solving the above differential equation under the initial condition y(k) = 0, where k is any real number. We can extract a particular solution by setting C some numerical value, for example, C = 1, which is the same as to set up the initial condition y(0) = 2.
Points (±1,0) are not singular points because at this points the solution can be obtained from the general solution by setting the arbitrary constant C = ∞, and its streamline has infinite slope at these points. Therefore, the equilibrium solution y ≡ 0 is not a singular solution and the general solution contains all possible solutions upon choose an appropriate value of a constant C.
■
The trivial solution y ≡ 0 cannot be obtained from the general solution for any value of constant C, including infinity. Therefore, it is a singular solution. This function touches one solution
\( y = x^4 /16 \) that corresponds to C = 0.
■
Example 3:
The general solution to the equation \( y
' = x^2/y^2 /\sqrt{4-x^2} \)
can be found by separation of variables:
In this command sequence, the first line of code asks Mathematica to find the solution to this separable differential equation.
The second line contains commands to plot different possible solutions to this separable differential equation based on the value of the integration constants. None of the subcommands of Plot are new in this command sequence and they have already been explained earlier.
We would like to use advantage of knowing Mathematica to solve the equation by direct integration and then to plot those solutions:
Clear[t,y];
t0 = 0; y0 = 2; f[t_] = t/(1 + t^2); g[y_] = 1/y; (* define the initial values and the slope functions *)
In this syntax, the first command, Clear, clears out any previously existing values for the two variables, allowing you to redefine them.
The second command defines the different initial conditions and the two functions that you are trying to solve.
The first command line tells Mathematica which functions you want to integrate.
The fourth and fifth lines of codes tell Mathematica how you want to define the general solution and how you want to solve for the integration constant c.
The sixth line gives the final solution to this separable differential equation (this is also an initial value problem).
The final line tells Mathematica which function to plot and the range.
Finally, we plot the corresponding phase portrait with separatrix y ≡ 0.
In Mathematica, as the previous example shows, you can insert comments by adding a comment
surrounded by stars as in (* solution of the IVP *) and then parentheses. Even when variables can be separated, the final solution might
be accompanied by a warning message from Solve, or it might only be given as an
InverseFunction object.
Example 5:
Consider a separable differential equation: y' +ycos(x) =0
Example 6:
Consider a separable differential equation:
x(y+1)(y-3) dx +(1+5y)(x+2) dy =0.
We solve this equation by separating variables and then integrating:
Example 7: (Newton's Law of Cooling)
Separable equations arise in a wide range of application problems. The time of death of a murder victim is an
important question on many popular movies and television programs. How does a forensic scientist or a medical
examiner determine the time of death? Human beings have a temperature of 98.6^{○}F or
36.6^{○}C. If the surrounding temperature is cooler, then the body will cool down after death. Eventually, the temperature of the body will match the temperature of the environment. We should not expect the body to cool at a constant rate either. Think of how a hot cup of coffee or tea cools. The liquid will cool quite quickly during the first few minutes but will remain relatively warm for quite a long period.
The answer to our forensic question can be found by using Newton's law of cooling, which tells us that the rate of change of the temperature of a object is proportional to the difference between the temperature of the object and the temperature of the surrounding medium. Newton's law of cooling can be easily stated as a differential equation,
where T is the temperature of the object, T_{m} is the temperature of the surrounding medium,
and k is the proportionality constant.
Suppose that the temperature of the surrounding environment is 21^{○}C, and we know from experience
that a body under these conditions cools off approximately 1^{○}C during the first hour after death.
In order to determine a formula for the time of death, we must solve the initial value problem
we see that this equation is separable. Integrating both sides of the last equation, we obtain \( \ln \left( T-21 \right) = kt+C , \) since we are assuming that T > 21. Therefore,
Example 8:
A ball at the temperature 1200K (in kelvin units) is allowed to cool down in air at an ambient temperature of 300K. Assuming heat is lost only due to radiation, we can apply the Stefan–Boltzmann law. Then the differential equation for the temperature of the ball is given by
Example 9: (Mixing Problems)
There is a large class of problems in modeling known as mixing problems. These problems refer to situations where two are more substances are mixed together in a container or containers. For example, we might wish to model how chemicals are mixed together in a refinery, how pollutants are mixed together in a pond or a lake, how ingredients are mixed together when brewing beer, or even how various greenhouse gases mix together across different layers of the atmosphere.
Suppose that we have a large tank containing 4000 liters of water and that water containing 0.01 kg of salt per liter flows into the tank at a rate of 4 liters per minute. If the tank is also draining at a rate of 4 liters per minute, the water level in the tank will remain constant. We will assume that the water in the tank is constantly stirred so that the mixture of salt and water is uniform in the tank.
We can model the amount of salt in the tank using differential equations. If x(t) is the amount of salt in the tank at time t, then the rate at which the salt is changing in the tank is the difference between the rate at which salt is flowing into the tank and the rate at which it is leaving the tank, or
Of course, the salt flows into the tank at the rate of 4x0.01 = 0.04 kg (or 40 grams) of salt per minute. However, the rate at which the salt leaves the tank depends on x(t), the amount salt in the tank at time t. At time t, there is x(t)/4000 kg of salt in one liter. Therefore, salt flows out of the tank at a rate of 4 x(t)/4000 = x(t)/1000 kg per minute. The differential equation now becomes
Corollary:
Let f: Ω ⊂ ℝ² → ℝ and assume that there
exists \( ( x_0 , y_0 ) \in \Omega \) such that
\( f(x_0 , y_0 ) \ne 0 . \) Then
f(x,y) = p(x) q(y) for all
(x,y) ∈ Ω if and only if
Moreover, if the above condition holds, we can choose
\( \displaystyle p(x) = \frac{f(x, y_0 )}{f(x_0 , y_0 )}
\) and \( \displaystyle q(y) =
f(x_0 , y) \) as factors of f(x,y).
The tumor growth equation has one unstable equilibrium solution V ≡ 0.
▪
Cid, J.A., A simple method to find out when an ordinary differential equation is separable, International Journal of Mathematical Education in Science and Technology, 2009, Vol. 40, No. 5, pp. 659--662. https://doi.org/10.1080/00207390802136578
Plaat, O., Separation of variables, The American Mathematical Monthly, 1968, Vol. 75, No. 8, pp. 844--847. doi: 10.2307/2314332
Scott, D., When is an ordinary differential equation separable?, The American Mathematical Monthly, 1985, Vol. 92, No. 6, pp. 422--423. doi: 10.2307/2322452
Return to Mathematica page
Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)
Return to the Part 7 (Boundary Value Problems)