38.4.5 problem 5

Internal problem ID [6491]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 25. Second order differential equations. Further problems 25. page 1094
Problem number : 5
Date solved : Sunday, March 30, 2025 at 11:05:29 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)+diff(y(x),x)-2*y(x) = 2*cosh(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (9 \,{\mathrm e}^{4 x}+36 c_2 \,{\mathrm e}^{3 x}+36 c_1 -12 x -7\right ) {\mathrm e}^{-2 x}}{36} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 39
ode=D[y[x],{x,2}]+D[y[x],x]-2*y[x]==2*Cosh[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{36} e^{-2 x} \left (-12 x+9 e^{4 x}+36 c_2 e^{3 x}-4+36 c_1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) - 2*cosh(2*x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : Could not solve `-2*y(x) - 2*cosh(2*x) + Derivative(y(x), x) + Derivative(y(x), (x, 2))` using the method of undetermined coefficients (unable to solve for coefficients).