Solve differential equations by separating variables
Apply separation of variables to real-world problems
Separation of Variables
Many differential equations can be solved using a powerful technique called separation of variables. This method works when the equation has a special structure that allows us to separate the [latex]x[/latex] and [latex]y[/latex] terms completely.
separable differential equation
A separable differential equation is any equation that can be written in the form:
[latex]y^{\prime} = f(x)g(y)[/latex]
The term “separable” refers to the fact that the right-hand side can be separated into a function of [latex]x[/latex] times a function of [latex]y[/latex].
Here are examples of separable differential equations.
Example 1: [latex]y^{\prime} = (x^2 - 4)(3y + 2)[/latex]
Here [latex]f(x) = x^2 - 4[/latex] and [latex]g(y) = 3y + 2[/latex]
Example 2: [latex]y^{\prime} = 6x^2 + 4x[/latex]
Here [latex]f(x) = 6x^2 + 4x[/latex] and [latex]g(y) = 1[/latex]
Example 3: [latex]y^{\prime} = \sec y + \tan y[/latex]
Here [latex]f(x) = 1[/latex] and [latex]g(y) = \sec y + \tan y[/latex]
This can be factored as [latex](x + 3)(y - 2)[/latex], so [latex]f(x) = x + 3[/latex] and [latex]g(y) = y - 2[/latex]
Example 3 above is also called an autonomous differential equation because the right-hand side depends only on [latex]y[/latex], not on [latex]x[/latex].
The Method of Separation of Variables
If a differential equation is separable, you can solve it using the method of separation of variables.
Problem-Solving Strategy: Separation of Variables
Check for constant solutions: Find any values of [latex]y[/latex] that make [latex]g(y) = 0[/latex]. These correspond to constant solutions.
Separate the variables: Rewrite the differential equation in the form [latex]\frac{dy}{g(y)} = f(x)dx[/latex].
Integrate both sides: [latex]\int \frac{dy}{g(y)} = \int f(x)dx[/latex].
Solve for [latex]y[/latex]: Solve the resulting equation for [latex]y[/latex] if possible.
Apply initial conditions: If an initial condition exists, substitute the appropriate values for [latex]x[/latex] and [latex]y[/latex] into the equation and solve for the constant.
Important note!
[latex]\\[/latex]
Step 4 states “solve for [latex]y[/latex] if possible” because it’s not always possible to obtain [latex]y[/latex] as an explicit function of [latex]x[/latex]. Often we must be satisfied with finding [latex]y[/latex] as an implicit function of [latex]x[/latex].
Find a general solution to the differential equation [latex]y^{\prime} =\left({x}^{2}-4\right)\left(3y+2\right)[/latex] using the method of separation of variables.
Follow the five-step method of separation of variables.
In this example, [latex]f\left(x\right)={x}^{2}-4[/latex] and [latex]g\left(y\right)=3y+2[/latex]. Setting [latex]g\left(y\right)=0[/latex] gives [latex]y=-\frac{2}{3}[/latex] as a constant solution.
To solve this equation for [latex]y[/latex], first multiply both sides of the equation by [latex]3[/latex].
[latex]\text{ln}|3y+2|={x}^{3}-12x+3C[/latex]
Now we use some logic in dealing with the constant [latex]C[/latex]. Since [latex]C[/latex] represents an arbitrary constant, [latex]3C[/latex] also represents an arbitrary constant. If we call the second arbitrary constant [latex]{C}_{1}[/latex], the equation becomes
Again define a new constant [latex]{C}_{2}={e}^{{c}_{1}}[/latex] (note that [latex]{C}_{2}>0[/latex]):
[latex]|3y+2|={C}_{2}{e}^{{x}^{3}-12x}[/latex].
This corresponds to two separate equations: [latex]3y+2={C}_{2}{e}^{{x}^{3}-12x}[/latex] and [latex]3y+2=\text{-}{C}_{2}{e}^{{x}^{3}-12x}[/latex].
The solution to either equation can be written in the form [latex]y=\frac{-2\pm {C}_{2}{e}^{{x}^{3}-12x}}{3}[/latex].
Since [latex]{C}_{2}>0[/latex], it does not matter whether we use plus or minus, so the constant can actually have either sign. Furthermore, the subscript on the constant [latex]C[/latex] is entirely arbitrary, and can be dropped. Therefore the solution can be written as
[latex]y=\frac{-2+C{e}^{{x}^{3}-12x}}{3}[/latex].
No initial condition is imposed, so we are finished.
Watch the following video to see the worked solution to example above.
For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.
Follow the five-step method of separation of variables.
In this example, [latex]f\left(x\right)=2x+3[/latex] and [latex]g\left(y\right)={y}^{2}-4[/latex]. Setting [latex]g\left(y\right)=0[/latex] gives [latex]y=\pm 2[/latex] as constant solutions.
Divide both sides of the equation by [latex]{y}^{2}-4[/latex] and multiply by [latex]dx[/latex]. This gives the equation
Next we can remove the absolute value and let [latex]{C}_{2}[/latex] be either positive or negative. Then multiply both sides by [latex]y+2[/latex].
[latex]\begin{array}{}\\ \\ y - 2={C}_{2}\left(y+2\right){e}^{4{x}^{2}+12x}\hfill \\ y - 2={C}_{2}y{e}^{{}^{4{x}^{2}+12x}}+2{C}_{2}{e}^{{}^{4{x}^{2}+12x}}.\hfill \end{array}[/latex]
Now collect all terms involving y on one side of the equation, and solve for [latex]y\text{:}[/latex]
To determine the value of [latex]{C}_{2}[/latex], substitute [latex]x=0[/latex] and [latex]y=-1[/latex] into the general solution. Alternatively, we can put the same values into an earlier equation, namely the equation [latex]\frac{y - 2}{y+2}={C}_{2}{e}^{4{x}^{2}+12}[/latex]. This is much easier to solve for [latex]{C}_{2}\text{:}[/latex]