Artificial Intelligence 🤖
Differential equations
Ordinary differential equations
Separable ODEs

Separable ODEs

A first order, ordinary differential equation has separable variables if it is of the form

f(y)dydx=g(x)f(y) \frac{d y}{d x}=g(x)

or, if it can be expressed in the above form. We note that in Eq. (12.1), all functions of yy are multiplied by the derivative of yy with respect to xx, while all functions of xx can be separated from it,

f(y)dydxy-functions multiplied  by the derivative =g(x)x-functions  are separated \underbrace{f(y) \frac{d y}{d x}}_{\begin{array}{c} y \text {-functions multiplied } \\ \text { by the derivative } \end{array}}=\underbrace{g(x)}_{\begin{array}{c} x \text {-functions } \\ \text { are separated } \end{array}}

Method of separation of variables

Our objective is to find a solution for y(x)y(x). Naturally, to obtain a solution for y(x)y(x), we would choose to integrate the ODE. Doing so, with respect to xx, we obtain,

f(y)dydxdx=g(x)dx\int f(y) \frac{d y}{d x} d x=\int g(x) d x

Starting from Eq. (12.1), we can equivalently carry out the following steps.

Step 1: Separate the variables

f(y)dy=g(x)dxf(y) d y=g(x) d x

Step 2: Integrate both sides

f(y)dy=g(x)dx\int f(y) d y=\int g(x) d x

Step 3: Solve for y(x)\boldsymbol{y}(\boldsymbol{x})

i.e. obtain an explicit solution, if possible. If not, leave the solution in implicit form.

Before we move on to examples, we justify how we can split the derivative, dy/dxd y / d x, which represents the rate of change of yy with respect to xx into two differentials, namely dyd y and dxd x, thus allowing us to separate the variables as in Eqs. (12.3) and (12.4). The justification comes through the chain rule (in integral form). Comparing Eqs. (12.1) and (12.2), it is obvious that the RHS of the equations are equivalent. To show that the LHS are also equivalent, we define F(y(x))F(y(x)) as the antiderivative of f(y)f(y) with respect to yy such that F=f(y)F^{\prime}=f(y) or,

F(y(x))=f(y)dyF(y(x))=\int f(y) d y

Using the chain rule, we have:

ddx[F(y(x))]=f(y)dydx\frac{d}{d x}[F(y(x))]=f(y) \frac{d y}{d x}

Integrating both sides of Eq. (12.6) with respect to xx, gives:

ddx[F(y(x))]dx=f(y)dydxdxF(y(x))=f(y)dydxdx.\begin{aligned} \int \frac{d}{d x}[F(y(x))] d x & =\int f(y) \frac{d y}{d x} d x \\ F(y(x)) & =\int f(y) \frac{d y}{d x} d x . \end{aligned}

With the definition of F(y)F(y) as in Eq. (12.5), Eq. (12.7) justifies the general algorithm outlined above which is commonly used to solve separable ODEs.

Example 12.1 Find the general solution to the following ODE by separating the variables,

dydx=6y2x\frac{d y}{d x}=6 y^{2} x

Solution We solve this ODE following the algorithm outlined above.

  1. Separating the variables,
1y2dy=6xdx\frac{1}{y^{2}} d y=6 x d x
  1. Integrating both sides,
1y2dy=6xdx1y=3x2+c\begin{aligned} \int \frac{1}{y^{2}} d y & =6 \int x d x \\ -\frac{1}{y} & =3 x^{2}+c \end{aligned}

where cc is a constant.

  1. Solve for y(x)y(x),
y(x)=13x2+cy(x)=-\frac{1}{3 x^{2}+c}

The general solution given by Eq. (12.11) represents a 1-parameter family of solutions. This means that depending on the value of cc (the parameter), we obtain a different solution. With additional information, such as an initial condition, we can solve for the value of cc that satisfies the ODE and the IC; recall that this yields a particular solution. The interval of existence of the solution to the ODE posed ultimately depends on the value of cc which, in turn, depends on the IC. Suppose we have the IC y(0)=1y(0)=1. Substituting in Eq. (12.11) gives the particular solution as:

y(x)=113x2y(x)=\frac{1}{1-3 x^{2}}

What is the interval of existence of this solution? First, the ODE given by Eq. (12.8) is defined everywhere x,y\forall x, y. Second, we note that the particular solution (12.12) is undefined at 13x2=01-3 x^{2}=0, i.e. at x=±1/3x= \pm 1 / \sqrt{3}. Since the IC is given at x=0x=0, the interval of existence is given as

13<x<13-\frac{1}{\sqrt{3}}<x<\frac{1}{\sqrt{3}} \text {. }

The graph of the function given by Eq. (12.12) is shown in Fig. 12.1; the portion of the graph associated with the particular solution is shown in red.

Figure 12.1: Plot of the function given by Eq. (12.12). The interval of existence associated with the particular solution to ODE (12.8) which satisfies the IC given by y(0)=1y(0)=1, is shown in red. Example 12.2 Find the general solution to the following ODE by separating the variables,

dydx=2yx\frac{d y}{d x}=\frac{2 y}{x}
  1. Separating the variables,
1ydy=2xdx\frac{1}{y} d y=\frac{2}{x} d x
  1. Integrating both sides,
1ydy=21xdxlny=2lnx+c.\begin{aligned} \int \frac{1}{y} d y & =2 \int \frac{1}{x} d x \\ \ln |y| & =2 \ln |x|+c . \end{aligned}
  1. Solve for y(x)y(x). Exponentiating both sides,
y=ecx2|y|=e^{c} x^{2}

or,

y(x)=±ecx2.y(x)= \pm e^{c} x^{2} .

Setting k=eck=e^{c},

y(x)=±kx2.y(x)= \pm k x^{2} .

Physical applications

We will discuss applications of differential equations throughout these notes. Here, we briefly mention some examples of physical applications which are described by separable differential equations:

  • The growth of bacteria in biology

Suppose the number of bacteria in a yeast culture grows at a rate that is proportional to the number of bacteria present. Then, if we denote the number of bacteria by yy, time by tt and take the constant of proportionality to be kk then we may mathematically describe this process by,

dydt=ky(t)\frac{d y}{d t}=k y(t)
  • Radioactive decay

The same form of the ODE used in the first example may be used to describe radioactive decay in a radioactive isotope

dNdt=λN(t)\frac{d N}{d t}=-\lambda N(t)

where NN is the number of atoms in the isotope and λ>0\lambda>0 is the decay constant.

  • Newton's law of cooling

It has been proven experimentally that the rate of change of the temperature of a body, TbT_{b}, which has been immersed in a medium of some constant temperature, TmT_{m} is proportional to the difference between the temperatures in the body and the medium. This is described by the following separable ODE

dTbdt=k(TbTm)\frac{d T_{b}}{d t}=-k\left(T_{b}-T_{m}\right)

where Tb=Tb(t)T_{b}=T_{b}(t) and k>0k>0 is a proportionality constant.

In general, many physical problems that deal with temperature, decomposition/growth, and some simple chemical reactions take the form of the equations described above whose solutions involve the exponential function.

Exercises

  1. Solve the following IVP using the method of separation of variables,
dydt=2ty1+y,y(0)=1\frac{d y}{d t}=\frac{2 t y}{1+y}, \quad y(0)=1
  1. Solve the following ODE giving your answer in explicit form,
dydx=cos2(x)cos2(2y)\frac{d y}{d x}=\cos ^{2}(x) \cos ^{2}(2 y)