23.3.18 problem 8(h)

Internal problem ID [4159]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 4. The general linear differential equation of order n. Exercises at page 63
Problem number : 8(h)
Date solved : Tuesday, March 04, 2025 at 05:54:33 PM
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.006 (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 \left (x \right ) = \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.439 (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.418 (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} \]