73.14.2 problem 21.5 (ii)

Internal problem ID [15341]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 21. Nonhomogeneous equations in general. Additional exercises page 391
Problem number : 21.5 (ii)
Date solved : Monday, March 31, 2025 at 01:34:48 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

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

Maple. Time used: 0.044 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)+4*y(x) = 24*exp(2*x); 
ic:=y(0) = -2, D(y)(0) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -2 \sin \left (2 x \right )-5 \cos \left (2 x \right )+3 \,{\mathrm e}^{2 x} \]
Mathematica. Time used: 0.017 (sec). Leaf size: 25
ode=D[y[x],{x,2}]+4*y[x]==24*Exp[2*x]; 
ic={y[0]==-2,Derivative[1][y][0] ==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 3 e^{2 x}-2 \sin (2 x)-5 \cos (2 x) \]
Sympy. Time used: 0.085 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - 24*exp(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): -2, Subs(Derivative(y(x), x), x, 0): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 3 e^{2 x} - 2 \sin {\left (2 x \right )} - 5 \cos {\left (2 x \right )} \]