23.1.151 problem 152

Internal problem ID [4758]
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 : 152
Date solved : Tuesday, September 30, 2025 at 08:30:39 AM
CAS classification : [_linear]

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