Solve the differential equation (cos x - xsin x)y dx + (xcos…
Solve the differential equation $(\cos x - x\sin x)y\,dx + (x\cos x - 2y)\,dy = 0$.
Explanation of Method
With \(M=(\cos x-x\sin x)y\) and \(N=x\cos x-2y\), check \(\partial M/\partial y=\partial N/\partial x\); since these agree, the equation is exact and a potential function \(F(x,y)\) with \(F=C\) is found by integration.
Check exactness
\(\partial M/\partial y=\cos x-x\sin x\) and \(\partial N/\partial x=\cos x-x\sin x\). These are equal, so the equation is exact.
Integrate \(M\) with respect to \(x\)
\[F=\int(\cos x-x\sin x)y\,dx=y\int(\cos x-x\sin x)\,dx.\] Using integration by parts on \(\int x\sin x\,dx=-x\cos x+\sin x\), we get \[\int(\cos x-x\sin x)\,dx=x\cos x,\] so \(F(x,y)=xy\cos x+g(y)\).
Determine \(g(y)\)
\(\partial F/\partial y=x\cos x+g'(y)\) must equal \(N=x\cos x-2y\), so \(g'(y)=-2y\), giving \(g(y)=-y^2\) (absorbing the constant into \(C\)).
Write and verify the solution
So \(F(x,y)=xy\cos x-y^2\). Differentiating \(xy\cos x-y^2=C\) implicitly reproduces \[(\cos x-x\sin x)y+(x\cos x-2y)\frac{dy}{dx}=0,\] which is exactly the original equation. Confirmed symbolically: both \(\partial F/\partial x=M\) and \(\partial F/\partial y=N\) hold exactly.
Result
Final answer:
Verified as correct. The general solution is:
\[\boxed{\,xy\cos x-y^2=C\,}\]
equivalently, solving the quadratic in \(y\): \(y=\dfrac{x\cos x\pm\sqrt{x^2\cos^2x-4C}}{2}\), with \(C\) an arbitrary constant.