Linear ordinary differential equations

A linear ODE is an ODE of the form: y=a(x)y+b(x) where a(x) and b(x) are continuous functions.

Example

An example of linear ODE would be: y=5x2y+2x2 although, sometimes, we will find a linear ODE after doing some conversion. For example, we might have an ODE of the following form: y5x2=y+25

and we can rewrite it (multiplying by x2) to obtain the previous form.

In the particular case in which b(x)=0, we will say that the equation is homogeneous.

The resolution of this type of equations is divided into two steps.

  • Solve the homogeneous part.

We solve the equation: yh=a(x)yh. This is a separable ODE, therefore, easy to solve. This solution is: yh(x)=kea(x) dx

Example

In our example, we have: yh=5x2yhyh(x)=ke5x2 dx=ke53x3

  • Find a particular solution to the non homogeneous ODE.

We are going to use the method change of constants. Calling y1(x)=ea(x)dx we look for a particular solution of the type yp(x)=u(x)y1(x).

Let's designate that as a solution: yp=uy1+uy1=uy1+ua(x)y1yp=a(x)yp+b(x)=a(x)uy1+b(x)}u=b(x)y1

We solve the latter equation (it is enough to integrate both sides) and we already have a particular solution.

Example

In our example, we take y1(x)=e53x3 Then we look for a particular solution of the form yp(x)=u(x)y1(x). We have seen that u(x) has the following derivative u=b(x)y1(x)=2x2e53x3=2x2e53x3

and, integrating, we obtain: u(x)=2x2e53x3dx=25e53x3

Thus, yp(x)=25e53x3e53x3=25

Finally, the solution of the linear equation is y(x)=yh(x)+yp(x).

Notice that the constant appears in the homogeneous solution (it does not make sense to put integration constants in the homogenous part).

Therefore, in our example, the solution of the ODE is: y(x)=ke53x325