# xy'-3y=x-1? Solve DE

Apr 6, 2018

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

#### Explanation:

We have

$x \frac{\mathrm{dy}}{\mathrm{dx}} - 3 y = x - 1$

Divide all terms by $x$

$\frac{\mathrm{dy}}{\mathrm{dx}} - \frac{3 y}{x} = \frac{x - 1}{x}$

The ODE is now in a form where it can be solved using an integrating factor

Let $\mu = \exp \int - \frac{3}{x} = \exp \left(- 3 \ln x\right) = \exp \ln \left(\frac{1}{x} ^ 3\right) = \frac{1}{x} ^ 3$

Now multiply the whole equation by $\mu$

$\frac{1}{x} ^ 3 \frac{\mathrm{dy}}{\mathrm{dx}} - \frac{3 y}{x} ^ 4 = \frac{x - 1}{x} ^ 4$

The LHS factors as a derivative and we can integrate the RHS

$\int \frac{d}{\mathrm{dx}} \left(\frac{y}{x} ^ 3\right) \mathrm{dx} = \int {x}^{-} 3 - {x}^{-} 4 \mathrm{dx}$

$\frac{y}{x} ^ 3 = - \frac{1}{2} {x}^{-} 2 + \frac{1}{3} {x}^{-} 3 + a$

Solve for $y$

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