23.1.150 problem 151

Internal problem ID [4757]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 151
Date solved : Tuesday, September 30, 2025 at 08:30:38 AM
CAS classification : [_linear]

\begin{align*} x y^{\prime }&=x \sin \left (x \right )-y \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 17
ode:=x*diff(y(x),x) = sin(x)*x-y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\sin \left (x \right )-x \cos \left (x \right )+c_1}{x} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 25
ode=x*D[y[x],x]==x*Sin[x]-y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\int _1^xK[1] \sin (K[1])dK[1]+c_1}{x} \end{align*}
Sympy. Time used: 0.174 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*sin(x) + x*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x} - \cos {\left (x \right )} + \frac {\sin {\left (x \right )}}{x} \]