75.20.33 problem 672

Internal problem ID [17096]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.5 Linear equations with variable coefficients. The Lagrange method. Exercises page 148
Problem number : 672
Date solved : Monday, March 31, 2025 at 03:41:28 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+\frac {2 y^{\prime }}{x}-y&=4 \,{\mathrm e}^{x} \end{align*}

With initial conditions

\begin{align*} y \left (-\infty \right )&=0\\ y^{\prime }\left (-1\right )&=-{\mathrm e}^{-1} \end{align*}

Maple. Time used: 0.278 (sec). Leaf size: 10
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)/x-y(x) = 4*exp(x); 
ic:=y(-infinity) = 0, D(y)(-1) = -1/exp(1); 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (-1+x \right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.089 (sec). Leaf size: 12
ode=D[y[x],{x,2}]+2/x*D[y[x],x]-y[x]==4*Exp[x]; 
ic={y[-Infinity]==0,Derivative[1][y][-1]==-1/Exp[1]}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^x (x-1) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) - 4*exp(x) + Derivative(y(x), (x, 2)) + 2*Derivative(y(x), x)/x,0) 
ics = {y(-inf): 0, Subs(Derivative(y(x), x), x, -1): -exp(-1)} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x*(y(x) + 4*exp(x) - Derivative(y(x), (x, 2)))/2 + Derivative(y(x), x) cannot be solved by the factorable group method