78.9.3 problem 3 (a and b)

Internal problem ID [18180]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 14. Introduction. Problems at page 112
Problem number : 3 (a and b)
Date solved : Monday, March 31, 2025 at 05:22:00 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)-diff(y(x),x)-2*y(x) = 4*x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} c_2 +{\mathrm e}^{2 x} c_1 -2 x +1 \]
Mathematica. Time used: 0.014 (sec). Leaf size: 26
ode=D[y[x],{x,2}] - D[y[x],x] -2*y[x] ==4*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -2 x+c_1 e^{-x}+c_2 e^{2 x}+1 \]
Sympy. Time used: 0.161 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-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^{- x} + C_{2} e^{2 x} - 2 x + 1 \]