# Is there no general solution to this?: $xdy = (x\sin(x)-y)dx$

I need to not only find a general solution for the given DE (using the method of finding the integrating factor) but also find an interval on which the general solution is defined.

For the first part I found the integrating factor to be $e^x$. Then,

$$My = e^x$$

$$Nx = e^x + xe^x$$

Am I to come to the conclusion that there is no general solution to this DE because $My$ does not equal $Nx$?

Edit - The method used MUST BE by finding the integrating factor (it says so in the homework).

• In response to your question edit.. Rearrange your equation to get $$xy' + y= x \sin(x)$$ which is in the form $a(x)y' + b(x)y = f(x)$. Then your integrating factor is given by $$\exp \bigg( \int \frac{b(x)}{a(x)} dx \bigg) = \exp \bigg( \int \frac{1}{x} dx \bigg) = x$$ – Mattos Jun 9 '15 at 15:43
• I see what I was doing wrong - I wasn't doing one of the following: either get $y'$ by itself or use your method of doing $b(x)$/$a(x)$. – DarthVoid Jun 9 '15 at 15:52

You have the wrong integrating factor.

The equation is $$x\frac{dy}{dx} = x\sin x - y$$

Let $y = \frac vx$. Then $$x\frac{dy}{dx} = \frac{dv}{dx} - \frac1x v$$ and the equation becomes $$\frac{dv}{dx} = x\sin x\\ v = \sin x - x\cos x + C \\ y = \frac{\sin x}{x} -\cos x + \frac Cx$$

• I dont see how this is using the method of finding an integrating factor. I have to find $e^{\int P(x)dx}$. – DarthVoid Jun 9 '15 at 15:39

The equation is already exact. Integrate

$$F_y=x$$

$$F=xy+A(x)$$

$$F_x=y-x\sin x=y+A'(x)$$

$$A=-\int x \sin x dx$$

Integrate by parts

$$A(x)=-\sin (x)+x \cos (x)$$

$$F=xy-\sin (x)+x \cos (x)=C$$

Hint:

your equation become: $$xy'-x\sin x +y=0$$ that, since $x'=1$ is: $$xy'+x'y=x \sin x \iff (xy)'=x \sin x$$

now you can integrate.