# What is a general solution to the differential equation xy'-2y=x^3?

Feb 3, 2017

$y = {x}^{3} + A {x}^{2}$

#### Explanation:

First write the DE in standard form:

$x y ' - 2 y = {x}^{3}$
$y ' - 2 \frac{y}{x} = {x}^{2}$ ..... [1]

This is a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

This is a standard form of a Differential Equation that can be solved by using an Integrating Factor:

$I = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\setminus \setminus = {e}^{\int \setminus - \frac{2}{x} \setminus \mathrm{dx}}$
$\setminus \setminus = {e}^{- 2 \ln x}$
$\setminus \setminus = {e}^{\ln} \left(- \frac{1}{x} ^ 2\right)$
$\setminus \setminus = - \frac{1}{x} ^ 2$

And if we multiply the DE [1] by this Integrating Factor we will have a perfect product differential;

$- \frac{1}{x} ^ 2 y ' + 2 \frac{y}{x} ^ 3 = - 1$
$\frac{d}{d} \left(- \frac{y}{x} ^ 2\right) = - 1$

This has converted our DE into a First Order separable DE which we can now just separate the variables to get;

$- \frac{y}{x} ^ 2 = \int - 1 \mathrm{dx}$

Which we can easily integrate to get:

$- \frac{y}{x} ^ 2 = - x + c$
$\therefore y = {x}^{3} + A {x}^{2}$

We can check our solution;

$y = {x}^{3} + A {x}^{2} \implies y ' = 3 {x}^{2} + 2 A x$

And so;

$x y ' - 2 y = x \left(3 {x}^{2} + 2 A x\right) - 2 \left({x}^{3} + A {x}^{2}\right)$
$\text{ } = 3 {x}^{3} + 2 A {x}^{2} - 2 {x}^{3} - 2 A {x}^{2}$
$\text{ } = {x}^{3} \setminus \setminus$ QED