Linear ordinary differential equations

Solve the equation: $x^2 \cdot y' +2x\cdot y=1$

This is a linear ODE, since dividing the equation by $x$ (note that $x$ cannot be a zero, since the equality would not be satisfied).

Therefore, the ODE can be re-written as: $$y'=-\dfrac{2}{x}\cdot y+\dfrac{1}{x^2}=a(x)\cdot y+b(x)$$ and clearly, that is a linear ODE.

Homogeneous ODE:

We look for a solution of the homogeneous ODE: $y'=-\dfrac{2}{x}\cdot y$ which is a separable ODE that we can solve: $$\dfrac{dy}{dx}=-\dfrac{2}{x}\cdot y \Rightarrow \dfrac{dy}{y}=-\dfrac{2}{x}dx \Rightarrow \int \dfrac{dy}{y}=-\int \dfrac{2}{x}dx \Rightarrow $$ $$\Rightarrow \ln|y|=\ln|x^{-2}|+C \Rightarrow y(x)=\dfrac{k}{x^2}, \ k\in\mathbb{R}$$

Non homogeneous ODE:

We look for a particular solution of the type $y_p(x)=u(x)\cdot y_1(x)$ where $y_1(x)=\dfrac{1}{x^2}$. We know that the function $u(x)$ is a solution of $$u'=\dfrac{b(x)}{y_1}=\dfrac{\dfrac{1}{x^2}}{\dfrac{1}{x^2}}=1$$ therefore $u(x)=x$.

And so, a particular solution is: $$y_p(x)=u(x)\cdot y_1(x)=x\cdot\dfrac{1}{x^2}=\dfrac{1}{x}$$ Finally, the solution will be the sum: $$y(x)=y_h(x)+y_p(x)=\dfrac{k}{x^2}+\dfrac{1}{x}, \ k\in\mathbb{R}$$

$$y(x)=\dfrac{k}{x^2}+\dfrac{1}{x}, \ k\in\mathbb{R}$$

Back to topic