# Math Help - The Integrating Factor

1. ## The Integrating Factor

I have another differential equation which is quite similar to the first. I tried to work it out the same way buy I'm not sure how to do it.

Solve x*dy/dx-y = x given y(1)=2. Express your answer in terms of y.
y= ?

I have no idea how to do this question now as I'm not sure how to use the integrating factor properly. Could someone please work through this question or show how to get up to what needs to be integrated.

2. $x \frac{dy}{dx} -y= x$

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

$P(x) = -\frac{1}{x}$

so the integrating factor is $e^{-\int \frac{1}{x} \ dx} = e^{-\ln x} = x^{-1} = \frac{1}{x}$

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

$\int \frac{d}{dx} \Big(\frac{y}{x}\Big) \ dx = \int \frac{1}{x} \ dx$

$\frac{y}{x} = \ln x + C$

$y = x \ln x + Cx$

$2 = 1 \ln 1 + C(1)$

$2 = C$

$y = x \ln x + 2x$

3. Thanks Random Variable,

This was a great help. I can see where I went wrong with my working. I didn't treat x^-1 correctly.