64.11.26 problem 26

Internal problem ID [13397]
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 : 26
Date solved : Wednesday, March 05, 2025 at 09:52:00 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (0\right )&=0\\ y^{\prime }\left (0\right )&=3 \end{align*}

Maple. Time used: 0.022 (sec). Leaf size: 19
ode:=diff(diff(y(x),x),x)+5*diff(y(x),x)+4*y(x) = 16*x+20*exp(x); 
ic:=y(0) = 0, D(y)(0) = 3; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = 3 \,{\mathrm e}^{-x}-5+2 \,{\mathrm e}^{x}+4 x \]
Mathematica. Time used: 0.348 (sec). Leaf size: 141
ode=D[y[x],{x,2}]+5*D[y[x],x]+4*y[x]==16*x+20*Exp[x]; 
ic={y[0]==0,Derivative[1][y][0] ==3}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-4 x} \left (\int _1^x-\frac {4}{3} e^{4 K[1]} \left (4 K[1]+5 e^{K[1]}\right )dK[1]-e^{3 x} \int _1^0\frac {4}{3} e^{K[2]} \left (4 K[2]+5 e^{K[2]}\right )dK[2]+e^{3 x} \int _1^x\frac {4}{3} e^{K[2]} \left (4 K[2]+5 e^{K[2]}\right )dK[2]-\int _1^0-\frac {4}{3} e^{4 K[1]} \left (4 K[1]+5 e^{K[1]}\right )dK[1]+e^{3 x}-1\right ) \]
Sympy. Time used: 0.218 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-16*x + 4*y(x) - 20*exp(x) + 5*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(x), x), x, 0): 3} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 4 x + 2 e^{x} - 5 + 3 e^{- x} \]