Table of Contents

Solving Separable Differential Equations Examples 1
Recall from the Solving Separable Differential Equations page that if we have a separable differential equation $M(x) + N(y) \frac{dy}{dx} = 0$, then we can rewrite it as:
(1)
Provided that these integrals can be evaluated and that they’re not too difficult to do so, then we can obtain solutions for the separable differential equation.
We will now look at some examples of solving separable differential equations. At this present time, we will not be concerned as to whether these solutions are always valid for all of $\mathbb{R}$. In fact, many of the solutions we present are only defined on a specific interval. We will look more into this later.
Example 1
Find all solutions to the differential equation $\frac{dy}{dx} = xe^{x^2} e^{\ln (y^2)}$.
We will first rewrite the differential equation above so that it is in the appropriate form.
(2)
The integral on the lefthand side is relatively easy to compute, but for the integral on the righthand side we will use substitution. Let $u = x^2$. Then $du = 2x \: dx$ and so we have that $\int xe^{x^2} \: dx = \int \frac{e^u}{2} \: du = \frac{e^u}{2} + C = \frac{e^{x^2}}{2} + C$ and therefore for $C$ as a constant our solution to our differential equation is:
(3)
Example 2
Solve the initial value problem $\frac{dy}{dx} = \frac{4 \sin 2x}{y}$ where $y(0) = 1$. For what interval is this solution valid?
We will first rewrite the differential equation above as $y \frac{dy}{dx} = 4 \sin 2x$. So for $C > 4$ as a constant we have that:
(4)
Now we will solve the initial value problem. Note that we have two sets of solutions, that is $y = \sqrt{4 \cos 2x + 2C}$ and $y = \sqrt{4 \cos 2x + 2C}$. We were given the initial value $y(0) = 1$ and so we’re dealing with the positive square root $y = \sqrt{4 \cos 2x +2C}$. Some solutions for the differential equation above with regards to the positive square root $y = \sqrt{4 \cos 2x +2C}$ are given in the graph below:
Now, plugging in $y(0) = 1$ we get that:
(5)
Therefore our solution to the initial value problem is $y = \sqrt{4 \cos 2x + 5}$.
We note that our solution is valid provided that $4 \cos 2x + 5 ≥ 0$. However, the cosine function is bounded since $1 ≤\cos 2x ≤ 1$ and so $4 ≤ 4 \cos 2x ≤ 4$. As a result, $4 ≤ 4 \cos 2x$ and so $4 \cos 2x + 5 ≥ 1 ≥ 0$ for all $x \in \mathbb{R}$. Therefore our solution is valid for all $x \in \mathbb{R}$.
The following image is the graph of our solution $y = \sqrt{4\cos 2x + 5}$:
Example 3
Find all solutions to the differential equation $\frac{dy}{dx} = e^{x}y^2 – e^{x} + y^2 – 1$.
We first note that we can rewrite the following differential equation above as $\frac{dy}{dx} = (e^{x} + 1)(y^2 – 1)$ and separate and solve it as follows:
(6)
The integral on the lefthand side will be rather tedious to compute, but it can be done by partial fractions. We note that $\frac{1}{y^2 – 1} = \frac{1}{(y + 1)(y – 1)} = \frac{A}{(y + 1)} + \frac{B}{(y – 1)}$ for some $A, B \in \mathbb{R}$. Thus we have that $\frac{1}{(y+1)(y1)} = \frac{A(y 1) + B(y + 1)}{(y + 1)(y – 1)}$ which implies that $1 = A(y – 1) + B(y + 1)$. If we let $y = 1$ then $A = \frac{1}{2}$, and if we let $y = 1$ then $B = \frac{1}{2}$ and so:
(7)
Thus we have that (ignoring adding the constant of integration):
(8)
Therefore going back to our differential equation, we have that:
(9)
Notice that both $y = 1$ and $y = 1$ are solutions to our differential equation as well. Thus all solutions are given by $\ln \biggr \rvert \frac{y – 1}{y + 1} \biggr \rvert = 2e^{x} + 2x + 2C$, $y = 1$, and $y = 1$.