29.6.3 problem 149

Internal problem ID [4749]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 6
Problem number : 149
Date solved : Tuesday, March 04, 2025 at 07:13:44 PM
CAS classification : [_linear]

\begin{align*} x y^{\prime }&=x^{2} \sin \left (x \right )+y \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 12
ode:=x*diff(y(x),x) = x^2*sin(x)+y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (-\cos \left (x \right )+c_{1} \right ) x \]
Mathematica. Time used: 0.036 (sec). Leaf size: 14
ode=x D[y[x],x]==x^2 Sin[x]+y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x (-\cos (x)+c_1) \]
Sympy. Time used: 0.311 (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 ) \]