8.11.2 problem 2

Internal problem ID [870]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 5.5, Nonhomogeneous equations and undetermined coefficients Page 351
Problem number : 2
Date solved : Tuesday, March 04, 2025 at 11:55:11 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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