64.11.6 problem 6

Internal problem ID [13377]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 6
Date solved : Wednesday, March 05, 2025 at 09:51:14 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-3 y^{\prime }-4 y&=16 x -12 \,{\mathrm e}^{2 x} \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)-3*diff(y(x),x)-4*y(x) = 16*x-12*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_{2} {\mathrm e}^{-x}+{\mathrm e}^{4 x} c_{1} +2 \,{\mathrm e}^{2 x}-4 x +3 \]
Mathematica. Time used: 0.466 (sec). Leaf size: 86
ode=D[y[x],{x,2}]-3*D[y[x],x]-4*y[x]==16*x-12*Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \left (\int _1^x\frac {4}{5} e^{K[1]} \left (3 e^{2 K[1]}-4 K[1]\right )dK[1]+e^{5 x} \int _1^x-\frac {4}{5} e^{-4 K[2]} \left (3 e^{2 K[2]}-4 K[2]\right )dK[2]+c_2 e^{5 x}+c_1\right ) \]
Sympy. Time used: 0.216 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-16*x - 4*y(x) + 12*exp(2*x) - 3*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^{4 x} - 4 x + 2 e^{2 x} + 3 \]