40.10.12 problem 21

Internal problem ID [6734]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 15. Linear equations with constant coefficients (Variation of parameters). Supplemetary problems. Page 98
Problem number : 21
Date solved : Sunday, March 30, 2025 at 11:20:58 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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

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