Solve the differential equation (x - ycos(y)/(x))dx +…
Solve the differential equation $\left(x - y\cos\frac{y}{x}\right)dx + x\cos\frac{y}{x}\,dy = 0$.
Explanation of Method
Both \(M(x,y) = x - y\cos(y/x)\) and \(N(x,y) = x\cos(y/x)\) are homogeneous of degree 1, so the substitution \(y = vx\) reduces the equation to separable form in \(x\) and \(v\).
Confirm the equation is homogeneous
With \(M(x,y) = x - y\cos(y/x)\) and \(N(x,y) = x\cos(y/x)\), scaling \((x,y)\to(tx,ty)\) gives \(M(tx,ty) = tM(x,y)\) and \(N(tx,ty) = tN(x,y)\). Both are homogeneous of degree 1, so the equation is homogeneous.
Substitute \(y = vx\)
Let \(y = vx\), so \(dy = v\,dx + x\,dv\) and \(y/x = v\). Then \(M = x(1 - v\cos v)\) and \(N = x\cos v\). Substituting:
\[x(1-v\cos v)\,dx + x\cos v\,(v\,dx + x\,dv) = 0.\]
Expanding and cancelling the \(v\cos v\) terms leaves
\[x\,dx + x^2\cos v\,dv = 0.\]
Separate variables
Dividing by \(x\) (with \(x\ne 0\)):
\[\frac{dx}{x} = -\cos v\,dv.\]
Integrate both sides
\[\int\frac{dx}{x} = -\int\cos v\,dv \quad\Longrightarrow\quad \ln|x| = -\sin v + C_1,\]
which rearranges to \(\ln|x| + \sin v = C\).
Back-substitute \(v = y/x\)
\[\ln|x| + \sin\frac{y}{x} = C.\]
Solving explicitly for \(y\) (where the arcsine is defined) gives \(y = x\arcsin(C - \ln|x|)\).
Verify by implicit differentiation
Differentiating \(\ln|x| + \sin(y/x) = C\) with respect to \(x\):
\[\frac{1}{x} + \cos\frac{y}{x}\cdot\frac{x y' - y}{x^2} = 0.\]
Multiplying through by \(x^2\) and then by \(dx\) reproduces exactly
\[\left(x - y\cos\frac{y}{x}\right)dx + x\cos\frac{y}{x}\,dy = 0,\]
the original equation. An independent symbolic check with sympy confirms this identity holds exactly, so the solution is verified.
Result
Final answer:
Boxed result:
\[\boxed{\ln|x| + \sin\frac{y}{x} = C}\]
equivalently \(y = x\arcsin(C - \ln|x|)\), where \(C\) is an arbitrary constant.