A linear ODE is an ODE of the form: $$$y'=a(x) \cdot y+b(x)$$$ where $$a(x)$$ and $$b(x)$$ are continuous functions.
An example of linear ODE would be: $$$y'=5x^2\cdot y+2x^2$$$ although, sometimes, we will find a linear ODE after doing some conversion. For example, we might have an ODE of the following form: $$$\displaystyle \frac {y'}{5x^2}=y+\frac{2}{5}$$$
and we can rewrite it (multiplying by $$x^2$$) 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: $$y'_h=a(x)\cdot y_h$$. This is a separable ODE, therefore, easy to solve. This solution is: $$$y_h(x)=k\cdot e^{\int a(x) \ dx}$$$
In our example, we have: $$$\displaystyle y'_h=5x^2y_h \Rightarrow y_h(x)=k\cdot e^{\int 5x^2 \ dx}=k \cdot e^{\frac{5}{3}x^3}$$$
- Find a particular solution to the non homogeneous ODE.
We are going to use the method change of constants. Calling $$y_1(x)=e^{\int a(x) dx}$$ we look for a particular solution of the type $$y_p(x)=u(x)\cdot y_1(x)$$.
Let's designate that as a solution: $$$\displaystyle \left.\begin{matrix} y'_p=u' \cdot y_1+u \cdot y'_1=u'\cdot y_1+u\cdot a(x) \cdot y_1 \\ y'_p=a(x) \cdot y_p+b(x)=a(x)\cdot u\cdot y_1+b(x) \end{matrix}\right\} \Rightarrow u'=\frac{b(x)}{y_1}$$$
We solve the latter equation (it is enough to integrate both sides) and we already have a particular solution.
In our example, we take $$$\displaystyle y_1(x)=e^{\frac{5}{3}x^3}$$$ Then we look for a particular solution of the form $$y_p(x)=u(x)\cdot y_1(x)$$. We have seen that $$u(x)$$ has the following derivative $$$\displaystyle u'=\frac{b(x)}{y_1(x)}=\frac{2x^2}{e^{\frac{5}{3}x^3}}=2x^2\cdot e^{-\frac{5}{3}x^3}$$$
and, integrating, we obtain: $$$\displaystyle u(x)=\int 2x^2\cdot e^{-\frac{5}{3}x^3} \cdot dx = -\frac{2}{5} e^{-\frac{5}{3}x^3}$$$
Thus, $$$y_p(x)=-\frac{2}{5} \cdot e^{-\frac{5}{3}x^3}\cdot e^{\frac{5}{3}x^3}=-\frac{2}{5} $$$
Finally, the solution of the linear equation is $$y(x)=y_h(x)+y_p(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)=k \cdot e^{\frac{5}{3}x^3}-\frac{2}{5}$$$