4.4.1 \(x y'(x)=x \sin (x)-y(x)\)

ODE
\[ x y'(x)=x \sin (x)-y(x) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.169064 (sec), leaf count = 19

\[\left \{\left \{y(x)\to \frac {\sin (x)-x \cos (x)+c_1}{x}\right \}\right \}\]

Maple
cpu = 0.02 (sec), leaf count = 17

\[\left [y \left (x \right ) = \frac {\sin \left (x \right )-x \cos \left (x \right )+\textit {\_C1}}{x}\right ]\] Mathematica raw input

DSolve[x*y'[x] == x*Sin[x] - y[x],y[x],x]

Mathematica raw output

{{y[x] -> (C[1] - x*Cos[x] + Sin[x])/x}}

Maple raw input

dsolve(x*diff(y(x),x) = x*sin(x)-y(x), y(x))

Maple raw output

[y(x) = (sin(x)-x*cos(x)+_C1)/x]