15.12.2 problem 2

Internal problem ID [3146]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 20, page 90
Problem number : 2
Date solved : Tuesday, March 04, 2025 at 04:03:22 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+4*y(x) = exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left ({\mathrm e}^{3 x}+9 c_{1} x +9 c_2 \right ) {\mathrm e}^{-2 x}}{9} \]
Mathematica. Time used: 0.028 (sec). Leaf size: 26
ode=D[y[x],{x,2}]+4*D[y[x],x]+4*y[x]==Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^x}{9}+e^{-2 x} (c_2 x+c_1) \]
Sympy. Time used: 0.193 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - exp(x) + 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} x\right ) e^{- 2 x} + \frac {e^{x}}{9} \]