75.17.20 problem 570

Internal problem ID [16998]
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.3 Nonhomogeneous linear equations with constant coefficients. Superposition principle. Exercises page 137
Problem number : 570
Date solved : Monday, March 31, 2025 at 03:37:35 PM
CAS classification : [[_2nd_order, _missing_y]]

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

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