7.2: Separable Equations
A first-order ode is separable if it can be written in the form
\[g(y) \frac{d y}{d x}=f(x), \quad y\left(x_{0}\right)=y_{0} \nonumber \]
where the function \(g(y)\) is independent of \(x\) and \(f(x)\) is independent of \(y\) . Integration from \(x_{0}\) to \(x\) results in
\[\int_{x_{0}}^{x} g(y(x)) y^{\prime}(x) d x=\int_{x_{0}}^{x} f(x) d x \nonumber \]
The integral on the left can be transformed by substituting \(u=y(x), d u=y^{\prime}(x) d x\) , and changing the lower and upper limits of integration to \(y\left(x_{0}\right)=y_{0}\) and \(y(x)=y\) . Therefore,
\[\int_{y_{0}}^{y} g(u) d u=\int_{x_{0}}^{x} f(x) d x, \nonumber \]
and since \(u\) is a dummy variable of integration, we can write this in the equivalent form
\[\int_{y_{0}}^{y} g(y) d y=\int_{x_{0}}^{x} f(x) d x \nonumber \]
A simpler procedure that also yields Equation \ref{7.3} is to treat \(d y / d x\) in Equation \ref{7.2} like a fraction. Multiplying Equation \ref{7.2} by \(d x\) results in
\[g(y) d y=f(x) d x, \nonumber \]
which is a separated equation with all the dependent variables on the left-side, and all the independent variables on the right-side. Equation Equation \ref{7.3} then results directly upon integration.
Solve \(\frac{d y}{d x}+\frac{1}{2} y=\frac{3}{2}\), with \(y(0)=2\).
Solution
We first manipulate the differential equation to the form
\[\frac{d y}{d x}=\frac{1}{2}(3-y) \nonumber \]
and then treat \(d y / d x\) as if it was a fraction to separate variables:
\[\frac{d y}{3-y}=\frac{1}{2} d x \nonumber \]
We integrate the right-side from the initial condition \(x=0\) to \(x\) and the left-side from the initial condition \(y(0)=2\) to \(y\) . Accordingly,
\[\int_{2}^{y} \frac{d y}{3-y}=\frac{1}{2} \int_{0}^{x} d x \nonumber \]
The integrals in Equation \ref{7.5} need to be done. Note that \(y(x)<3\) for finite \(x\) or the integral on the left-side diverges. Therefore, \(3-y>0\) and integration yields
\[\begin{gathered} \left.-\ln (3-y)]_{2}^{y}=\frac{1}{2} x\right]_{0^{\prime}}^{x} \\ \ln (3-y)=-\frac{1}{2} x \\ 3-y=e^{-x / 2} \\ y=3-e^{-x / 2} \end{gathered} \nonumber \]
Since this is our first nontrivial analytical solution, it is prudent to check our result. We do this by differentiating our solution:
\[\begin{aligned} \frac{d y}{d x} &=\frac{1}{2} e^{-x / 2} \\ &=\frac{1}{2}(3-y) \end{aligned} \nonumber \]
and checking the initial condition, \(y(0)=3-e^{0}=2\) . Therefore, our solution satisfies both the original ode and the initial condition.
Solve \(\frac{d y}{d x}+\frac{1}{2} y=\frac{3}{2}\), with \(y(0)=4\).
Solution
This is the identical differential equation as before, but with different initial conditions. We will jump directly to the integration step:
\[\int_{4}^{y} \frac{d y}{3-y}=\frac{1}{2} \int_{0}^{x} d x . \nonumber \]
Now \(y(x)>3\) , so that \(y-3>0\) and integration yields
\[\begin{gathered} \left.-\ln (y-3)]_{4}^{y}=\frac{1}{2} x\right]_{0^{\prime}}^{x} \\ \ln (y-3)=-\frac{1}{2} x \\ y-3=e^{-x / 2} \\ y=3+e^{-x / 2} \end{gathered} \nonumber \]
The solution curves for a range of initial conditions is presented in Fig. 7.2. All solutions have a horizontal asymptote at \(y=3\) at which \(d y / d x=0\) . For \(y(0)=y_{0}\) , the general solution can be shown to be \(y(x)=3+\left(y_{0}-3\right) \exp (-x / 2)\) .
Solve \(\frac{d y}{d x}=\frac{2 \cos 2 x}{3+2 y}\), with \(y(0)=-1\). (i) For what values of \(x>0\) does the solution exist? (ii) For what value of \(x>0\) is \(y(x)\) maximum?
Solution
Notice that the derivative of \(y\) diverges when \(y=-3 / 2\) , and that this may cause some problems with a solution.
We solve the ode by separating variables and integrating from initial conditions:
\[\begin{gathered} (3+2 y) d y=2 \cos 2 x d x \\ \int_{-1}^{y}(3+2 y) d y=2 \int_{0}^{x} \cos 2 x d x \\ \left.\left.3 y+y^{2}\right]_{-1}^{y}=\sin 2 x\right]_{0}^{x} \\ y^{2}+3 y+2-\sin 2 x=0 \\ y_{\pm}=\frac{1}{2}[-3 \pm \sqrt{1+4 \sin 2 x}] \end{gathered} \nonumber \]
Solving the quadratic equation for \(y\) has introduced a spurious solution that does not satisfy the initial conditions. We test:
\[y_{\pm}(0)=\frac{1}{2}[-3 \pm 1]=\left\{\begin{array}{l} -1 \\ -2 \end{array}\right. \nonumber \]
Only the \(+\) root satisfies the initial condition, so that the unique solution to the ode and initial condition is
\[y=\frac{1}{2}[-3+\sqrt{1+4 \sin 2 x}] . \nonumber \]
To determine (i) the values of \(x>0\) for which the solution exists, we require
\[1+4 \sin 2 x \geq 0 \nonumber \]
or
\[\sin 2 x \geq-\frac{1}{4} \nonumber \]
Notice that at \(x=0\) , we have \(\sin 2 x=0\) ; at \(x=\pi / 4\) , we have \(\sin 2 x=1\) ; at \(x=\pi / 2\) , we have \(\sin 2 x=0\) ; and at \(x=3 \pi / 4\) , we have \(\sin 2 x=-1\) We therefore need to determine the value of \(x\) such that \(\sin 2 x=-1 / 4\) , with \(x\) in the range \(\pi / 2<x<3 \pi / 4\) . The solution to the ode will then exist for all \(x\) between zero and this value.
To solve \(\sin 2 x=-1 / 4\) for \(x\) in the interval \(\pi / 2<x<3 \pi / 4\) , one needs to recall the definition of arcsin, or \(\sin ^{-1}\) , as found on a typical scientific calculator. The inverse of the function
\[f(x)=\sin x, \quad-\pi / 2 \leq x \leq \pi / 2 \nonumber \]
is denoted by arcsin. The first solution with \(x>0\) of the equation \(\sin 2 x=-1 / 4\) places \(2 x\) in the interval \((\pi, 3 \pi / 2)\) , so to invert this equation using the arcsine we need to apply the identity \(\sin (\pi-x)=\sin x\) , and rewrite \(\sin 2 x=-1 / 4\) as \(\sin (\pi-2 x)=-1 / 4\) . The solution of this equation may then be found by taking the arcsine, and is
\[\pi-2 x=\arcsin (-1 / 4), \nonumber \]
\[x=\frac{1}{2}\left(\pi+\arcsin \frac{1}{4}\right) . \nonumber \]
Therefore the solution exists for \(0 \leq x \leq(\pi+\arcsin (1 / 4)) / 2=1.6971 \ldots\) , where we have used a calculator value (computing in radians) to find \(\arcsin Equation \ref{0.25}=\) \(0.2527 \ldots\) At the value \((x, y)=(1.6971 \ldots,-3 / 2)\) , the solution curve ends and \(d y / d x\) becomes infinite.
To determine (ii) the value of \(x\) at which \(y=y(x)\) is maximum, we examine Equation \ref{7.6} directly. The value of \(y\) will be maximum when \(\sin 2 x\) takes its maximum value over the interval where the solution exists. This will be when \(2 x=\pi / 2\) , or \(x=\pi / 4=0.7854 \ldots\)
The graph of \(y=y(x)\) is shown in Fig. 7.3.