Solveeit Logo

Question

Question: x dy/dx + y - x + xy cot x = 0...

x dy/dx + y - x + xy cot x = 0

Answer

y=sinxxcosx+Cxsinxy = \frac{\sin x - x \cos x + C}{x \sin x}

Explanation

Solution

The given differential equation is: xdydx+yx+xycotx=0x \frac{dy}{dx} + y - x + xy \cot x = 0 Rearranging to the standard linear form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x) y = Q(x): dydx+y(1x+cotx)=1\frac{dy}{dx} + y \left(\frac{1}{x} + \cot x\right) = 1 Here, P(x)=1x+cotxP(x) = \frac{1}{x} + \cot x and Q(x)=1Q(x) = 1.

The integrating factor (IF) is calculated as: IF=eP(x)dx=e(1x+cotx)dxIF = e^{\int P(x) dx} = e^{\int \left(\frac{1}{x} + \cot x\right) dx} IF=elnx+lnsinx=elnxsinx=xsinxIF = e^{\ln|x| + \ln|\sin x|} = e^{\ln|x \sin x|} = |x \sin x| We use IF=xsinxIF = x \sin x.

The general solution of a linear first-order differential equation is given by yIF=Q(x)IFdx+Cy \cdot IF = \int Q(x) \cdot IF dx + C. y(xsinx)=1(xsinx)dx+Cy (x \sin x) = \int 1 \cdot (x \sin x) dx + C yxsinx=xsinxdx+Cy x \sin x = \int x \sin x dx + C Using integration by parts for xsinxdx\int x \sin x dx (with u=xu=x and dv=sinxdxdv=\sin x dx), we get: xsinxdx=xcosx+sinx\int x \sin x dx = -x \cos x + \sin x Substituting this result back into the solution equation: yxsinx=xcosx+sinx+Cy x \sin x = -x \cos x + \sin x + C Solving for yy, we get the general solution: y=xcosx+sinx+Cxsinxy = \frac{-x \cos x + \sin x + C}{x \sin x} This can also be written as: y=sinxxcosx+Cxsinxy = \frac{\sin x - x \cos x + C}{x \sin x}