✓ Mathematica : cpu = 0.0249507 (sec), leaf count = 24
DSolve[-(x*Sin[x]) + y[x] + x*Derivative[1][y][x] == 0,y[x],x]
✓ Maple : cpu = 0.03 (sec), leaf count = 17
dsolve(x*diff(y(x),x)+y(x)-x*sin(x) = 0,y(x))
Hand solution
Linear first order, exact, separable. \(y^{\prime }+\frac {y}{x}=\sin x\), integrating factor \(\mu =e^{\int \frac {1}{x}dx}=x\), hence
Using integration by parts. \(\int udv=uv-\int vdu\). Let \(u=x,dv=\sin x\), hence \(du=1,v=-\cos x\), therefore
Hence
Verification
restart; ode:=x*diff(y(x),x)+y(x)=x*sin(x); my_sol:=sin(x)/x-cos(x)+_C1/x; odetest(y(x)=my_sol,ode); 0