82.40.4 problem Ex. 4

Internal problem ID [18871]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VIII. Exact differential equations, and equations of particular forms. Integration in series. problems at page 94
Problem number : Ex. 4
Date solved : Thursday, March 13, 2025 at 01:04:57 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)+2*exp(x)*diff(y(x),x)+2*y(x)*exp(x) = x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {\left (3 c_{2} +\int \left (x^{3}+3 c_{1} \right ) {\mathrm e}^{2 \,{\mathrm e}^{x}}d x \right ) {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{3} \]
Mathematica. Time used: 60.032 (sec). Leaf size: 44
ode=D[y[x],{x,2}]+2*Exp[x]*D[y[x],x]+2*Exp[x]*y[x]==x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 e^x} \left (\int _1^x\frac {1}{3} e^{2 e^{K[1]}} \left (K[1]^3+3 c_1\right )dK[1]+c_2\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + 2*y(x)*exp(x) + 2*exp(x)*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -(x**2 - 2*y(x)*exp(x) - Derivative(y(x), (x, 2)))*exp(-x)/2 + Derivative(y(x), x) cannot be solved by the factorable group method