First order separable ordinary differential equations

For a first order ODE to be considered separable, the form it has to be in is

\[\frac{dy}{dx}=P(x)Q(y)\]

What this means is that the differential \(\left(\frac{dy}{dx}\right)\) needs to be equal to two separate functions that are multiplied together with one of the functions containing all of the \(y\)'s and the other containing all of the \(x\)'s.

\[\frac{dy}{dx}=P(x)Q(y)\]

In order to solve this, we will first separate the two functions, putting the one containing the variable we are differentiating on the left side

\[\frac{1}{Q(y)}\left(\frac{dy}{dx}=P(x)Q(y)\right)\]

Multiplying this into both sides of our equation will cancel out the \(Q(y)\) on the right side and give us

\[\frac{1}{Q(y)}\frac{dy}{dx} = P(x)\]

Now we will integrate both sides with respect to \(x\)

\[\int \frac{1}{Q(y)} \frac{dy}{dx} \,dx = \int P(x) \, dx\]

Remembering back to the change of variables integration method (and that the \(y\)'s were working with can be seen as functions of \(x\)), we have the substitution

\[u = y(x) \qquad du = \frac{dy}{dx} \, dx\]

which when substituted in will give us...

\[\int \frac{1}{Q(u)} \, du = \int P(x) \, dx\]

From here we can solve each side as though they were their own integrals (don't forget the \(+c\)). After integrating, and once we do substitute the \(y(x)\) back in for \(u\), we will have found the general solution to our separable differential equation

Now that we have seen the "correct" way to solve this, take note that (with the exception of the substitution, which we would substitute back to \(y\) anyway) we could get the same end result by treating the differential as a fraction.

\[\frac{dy}{dx}=P(x)Q(y)\]

Multiplying the equation by \(dx\)

\[ dx\left(\frac{dy}{dx}=P(x)G(y)\right)\]

The \(dx\)'s on the left cancel giving us

\[dy=P(x)Q(y)dx\]

Dividing by the function associated with \(y\)

\[\biggl(dy=P(x)Q(y)\,dx\biggl) \frac{1}{Q(y)}\]

The \(Q(y)\)'s cancel leaving us with

\[\frac{dy}{Q(y)} = P(x)dx\]

at which point we can integrate both sides

\[\int\frac{dy}{Q(y)} = \int P(x)dx\]

and same as before after integrating, we find the same solution as what we did above.

While "technically" we can't treat \(\frac{dy}{dx}\) as a fraction1. In most cases, and at least all cases that we'll be seeing in these lessons, treating \(\frac{dy}{dx}\) as a fraction and thinking of it as a ratio will yield the same results. Just know that technically when we are doing these manipulations, some other stuff is going on in the background to make it work. So for all intents and purposes, treat it as a fraction.

Links in this dropdown if you want to dig more into it.

In no particular order...
detaching dy and dx

when not to treat dy dx as a fraction

differentials as fractions

why can't dy dx be used as a fraction

is dy dx not a ratio?

how to treat differntials and infinitesimals


Now that we have the generalized walkthrough on solving it, lets look at a few examples of figuring out the \(P(x)\) and \(Q(y)\)
1.

The simplest would be something like

\[\frac{dy}{dx}= x^{4}y\]
\[P(x)=x^{4} \quad Q(y)=y\]

With this you can see that \(P(x)\) times \(Q(y)\) is indeed \(x^{4}y\).

2.

Sometimes you will have to play around with it a little to get it into the seperable form

\[\frac{dy}{dt}= \frac{2}{xe^{t+2x}}\]
\[\frac{dy}{dt} = \frac{2}{xe^{t}e^{2x}}\]
\[\frac{dy}{dt}= \frac{2}{e^{t}} \frac{1}{xe^{2x}}\]
\[P(t) = \frac{2}{e^{2t}} \quad Q(y) = \frac{1}{xe^{2x}}\]

In this case, we have \(\frac{dy}{dt}\) and \(P(t)\) instead of \(P(x)\) nothing changes, its just a variable letter thats swapped. Also note that \(P(t)\) was given the 2 on top, this was arbitrarily chosen and could just as easily been on the \(Q(y)\) feel free to put the constants anywhere, all that matters is the variables.

3.

Sometimes you will have to play around with it alot to get it into the separable form, so feel free to manipulate and pull apart/put together the differentials

\[\left(x^{4}+8 x^{4} y^{4}\right) d x+e^{x^{5}} y^{3} d y=0\]
\[\left(x^{4}+8 x^{4} y^{4}\right) d x=-e^{x^{5}} y^{3} d y\]
\[\frac{dx}{dy}= \frac{-e^{x^{5}}y^{3}}{x^{4}+8 x^{4} y^{4}}\]
\[\frac{dx}{dy}= \frac{-e^{x^{5}}y^{3}}{x^{4}(1+8 y^{4})}\quad \Rightarrow \quad \frac{dx}{dy}=\frac{-e^{x^{5}}}{x^{4}} \frac{y^{3}}{1+8y^{4}}\]
\[P(x) = \frac{-e^{x^{5}}}{x^{4}} \quad Q(y) = \frac{y^{3}}{1+8y^{4}}\]

The thing to note here is that when I finished manipulating I went with \(\frac{dx}{dy}\) instead of \(\frac{dy}{dx}\) this also doesn't matter, and once separated and solved will yield the same results. All we care about is getting the differentials on one side, and splitting the variables into 2 separate functions

4.

One final simple example

\[\frac{d\phi}{d\omega} = \phi^3\]
\[P(\omega)=1 \quad Q(\phi) = \phi^3\]

When you only have 1 of the variables in the equation you can just set the other function to \(1\), we don't need both variables given in the differential to solve using this method


The hard part is recognizing that it is a separable differential equation, and manipulating it into the correct form. Let's take a quick look at solving one of these both with and without a given initial condition.


We find our \(P(x)\) and \(Q(y)\)

\[\frac{dy}{dx}= x^{4}y\]
\[P(x)=x^{4} \quad Q(y)=y\]

Multiply and Divide the equation to get all the y's with dy and all the x's with dx alone then integrate both sides

\[\frac{dy}{y}=x^{4}dx \quad \Rightarrow \quad \int\frac{dy}{y}=\int x^{4}dx\]

This leaves us with

\[\ln|y| +c= \frac{x^{5}}{5}+c\]

one constant eats the other

\[\ln|y| = \frac{x^{5}}{5} + c\]

and now lets solve for y

\[e^{\ln|y|} = e^{\frac{x^{5}}{5} + c}\]
\[y = e^{\frac{x^{5}}{5}}e^{c} \quad \Rightarrow \quad y=ce^{\frac{x^{5}}{5}}\]

This is the final answer assuming they don't give us an initial condition and are looking for it in explicit form.

Lets do one with an initial condition

\[x^{2}\frac{dy}{dx}=\frac{5x^{2}-x-2}{(x+1)(y+1)}\quad ; \quad y(1)=4\]
\[\frac{dy}{dx}= \frac{5x^{2}-x-2}{x^{2}(x+1)(y+1)}\]
\[P(x) = \frac{5x^{2}-x-2}{x^{2}(x+1)} \quad Q(y) = \frac{1}{y+1}\]

Multiply the equation by dx and divide by \(Q(y)\)

\[y+1\,dy = \frac{5x^{2}-x-2}{x^{2}(x+1)}\,dx\]

Integrate both sides

\[\frac{y^{2}}{2}+y +c= \int \frac{5x^{2}-x-2}{x^{2}(x+1)}\,dx\]

partial fractions

\[\frac{y^{2}}{2}+y +c= \int \frac{1}{x}-\frac{2}{x^{2}} +\frac{4}{x+1}\,dx\]
\[\frac{y^{2}}{2}+y +c=\ln|x| + \frac{2}{x} +4\ln(x+1) +c\]

1 c eats the other and then subtract to solve for c

\[c = \ln |x| + \frac{2}{x} + 4\ln|x+1| - \frac{y^{2}}{2}-y\]

plug in the initial condition of \(x=1\) and \(y = 4\) to solve for c

\[c = \ln|1| + \frac{2}{1} + 4\ln|1+1|- \frac{4^{2}}{2}-4\]
\[c=0+2+4\ln(2)-8-4\]
\[c=-10+4\ln(2)\]

now we just substitute what we solved for c into the original equation to give us the final answer in explicit form

\[\frac{y^{2}}{2}+y-10+4\ln(2)= \ln|x| + \frac{2}{x} +4\ln|x+1|\]

--> Linear Equations

Differential Equation Index
Home


  1. If we aren't supposed to treat \(\large \frac{dy}{dx}\) as a fraction, then why do we type it in LaTeX as \frac{dy}{dx}? Checkmate mathematicians ↩