Separable ordinary differential equations

Let's consider,y=f(x,y) with y, an ODE of first order . We will say that the EDO is separable if we can rewrite it as h(y)y=g(x), that is, if we can move everything that depends on y to one side of the equality and everything that depends on x to the other.

Example

An example of separable ODE would be y=2xy, since we can put everything that depends on the varible y to one side of the equality and everything that depends on x to other by dividing the entire equationby y: y=2xy1yy=2x In our case, then h(y)=1y, g(x)=2x

Then we integrate both sides of the equality and we obtain the solution: h(y)y=g(x)h(y)dydx=g(x)h(y)dy=g(x)dx h(y)dy=g(x)dx+C Let's note that we have added a constant, since, when integrating a function, we do not know if there was a constant. Now we try to isolate y in terms of x and obtain the solution.

Example

For example, in the case shown previously: 1yy=2x1ydydx=2xdyy=2xdxdyy=2xdx+Cln|y|=x2+C|y|=ex2+C=ex2eC=Kex2, k>0 y(x)=kex2, k>0

Something that is worth noting is that when we operated to get all the variables in one side, we may be losing some of the solutions. In a way in order to put all the y on one side we assumed that y0. However, if we look at the ODE we can realize that y=0 is actually a solution of the ODE, as far as k is also zero.

As we have already said, sometimes, we will have to solve a PVI. In the example we found all the solutions of the ODE. To find the solution of a PVI it is enough to impose the initial conditions and find the concrete constant that assures that the initial condition is satisfied.

Example

Let's consider, for example the PVI: {y=2xyy(0)=1 From the previous example we know that the solutions are: y(x)=kex2kR.

Let's look, then, tat he value of k so that we have y(0)=1: y(0)=11=y(0)=ke0k=1 Therefore, the solution to our PVI is: y(x)=ex2.

We are going to show some more examples:

Example

Solve the ODE: y=4xey This is a separable ODE since we can put everything that depends on x to one side and everything that depends on y to other.

In effect: yey=4x Now we proceed as we said: y=ey=4xdydxey=4xeydy=4xdxeydy=4xdx ey=2x2+Cy(x)=ln(2x2+C) where C is the constant that would be determined by the initial conditions.

Example

Solve the ODE: 2x+5=ysiny We observe that in this case we already have separated variables.

So let's proceed to the integrals: 2x+5=ysiny2x+5=sinydydx(2x+5) dx=siny dy x2+5x+C=cosyy(x)=arccos(x25xC)

Example

Solve the ODE: y=x(y2+1) It is again a separable ODE when we divide all the terms by y2+1. So its solution is obtained in the following way:

yy2+1=xdydx1y2+1=xdyy2+1=xdxdyy2+1=xdx arctany=x+Cy(x)=tan(x+C)