2.92   ODE No. 92

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

\[ x^2 (-\sin (x))+x y'(x)-y(x)=0 \] Mathematica : cpu = 0.0132669 (sec), leaf count = 14

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

Maple : cpu = 0.007 (sec), leaf count = 12

\[ \left \{ y \left ( x \right ) =x \left ( {\it \_C1}-\cos \left ( x \right ) \right ) \right \} \]

Hand solution

\[ xy^{\prime }-y=x^{2}\sin x \]

Linear first order, exact, separable. \(y^{\prime }-\frac {y}{x}=x\sin x\), integrating factor \(\mu =e^{\int -\frac {1}{x}dx}=e^{-\ln x}=\frac {1}{x}\), hence\begin {align*} d\left ( \mu y\right ) & =\mu \sin x\\ \frac {1}{x}y & =\int \sin xdx+C\\ y & =x\left ( C-\cos x\right ) \end {align*}

Verification

restart; 
ode:=x*diff(y(x),x)-y(x)=x^2*sin(x); 
my_sol:=x*(_C1-cos(x)); 
odetest(y(x)=my_sol,ode); 
0