87.1.5 problem 5

Internal problem ID [23217]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 9
Problem number : 5
Date solved : Thursday, October 02, 2025 at 09:24:30 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x y^{\prime \prime }+y&=x \,{\mathrm e}^{x} \end{align*}
Maple. Time used: 0.010 (sec). Leaf size: 76
ode:=x*diff(diff(y(x),x),x)+y(x) = x*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\int \sqrt {x}\, \operatorname {BesselJ}\left (1, 2 \sqrt {x}\right ) {\mathrm e}^{x}d x \pi \operatorname {BesselY}\left (1, 2 \sqrt {x}\right )-\int \sqrt {x}\, \operatorname {BesselY}\left (1, 2 \sqrt {x}\right ) {\mathrm e}^{x}d x \pi \operatorname {BesselJ}\left (1, 2 \sqrt {x}\right )+\operatorname {BesselY}\left (1, 2 \sqrt {x}\right ) c_1 +\operatorname {BesselJ}\left (1, 2 \sqrt {x}\right ) c_2 \right ) \sqrt {x} \]
Mathematica. Time used: 0.359 (sec). Leaf size: 126
ode=x*D[y[x],{x,2}]+y[x]==x*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sqrt {x} \left (\operatorname {BesselJ}\left (1,2 \sqrt {x}\right ) \int _1^x-e^{K[1]} \pi \operatorname {BesselY}\left (1,2 \sqrt {K[1]}\right ) \sqrt {K[1]}dK[1]+2 i \operatorname {BesselY}\left (1,2 \sqrt {x}\right ) \int _1^x-\frac {1}{2} i e^{K[2]} \pi \operatorname {BesselJ}\left (1,2 \sqrt {K[2]}\right ) \sqrt {K[2]}dK[2]+c_1 \operatorname {BesselJ}\left (1,2 \sqrt {x}\right )+2 i c_2 \operatorname {BesselY}\left (1,2 \sqrt {x}\right )\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(x) + x*Derivative(y(x), (x, 2)) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : solve: Cannot solve -x*exp(x) + x*Derivative(y(x), (x, 2)) + y(x)