Question
Question: x dy/dx + y - x + xy cot x = 0...
x dy/dx + y - x + xy cot x = 0
y=xsinxsinx−xcosx+C
Solution
The given differential equation is: xdxdy+y−x+xycotx=0 Rearranging to the standard linear form dxdy+P(x)y=Q(x): dxdy+y(x1+cotx)=1 Here, P(x)=x1+cotx and Q(x)=1.
The integrating factor (IF) is calculated as: IF=e∫P(x)dx=e∫(x1+cotx)dx IF=eln∣x∣+ln∣sinx∣=eln∣xsinx∣=∣xsinx∣ We use IF=xsinx.
The general solution of a linear first-order differential equation is given by y⋅IF=∫Q(x)⋅IFdx+C. y(xsinx)=∫1⋅(xsinx)dx+C yxsinx=∫xsinxdx+C Using integration by parts for ∫xsinxdx (with u=x and dv=sinxdx), we get: ∫xsinxdx=−xcosx+sinx Substituting this result back into the solution equation: yxsinx=−xcosx+sinx+C Solving for y, we get the general solution: y=xsinx−xcosx+sinx+C This can also be written as: y=xsinxsinx−xcosx+C