75.16.65 problem 538

Internal problem ID [16967]
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. Trial and error method. Exercises page 132
Problem number : 538
Date solved : Monday, March 31, 2025 at 03:36:44 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)+diff(y(x),x)-2*y(x) = x^2*exp(4*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} c_2 +{\mathrm e}^{-2 x} c_1 +\frac {\left (18 x^{2}-18 x +7\right ) {\mathrm e}^{4 x}}{324} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 39
ode=D[y[x],{x,2}]+D[y[x],x]-2*y[x]==x^2*Exp[4*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{324} e^{4 x} \left (18 x^2-18 x+7\right )+c_1 e^{-2 x}+c_2 e^x \]
Sympy. Time used: 0.240 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(4*x) - 2*y(x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x} + C_{2} e^{x} + \frac {\left (18 x^{2} - 18 x + 7\right ) e^{4 x}}{324} \]