64.12.7 problem 7

Internal problem ID [13432]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 7
Date solved : Wednesday, March 05, 2025 at 09:58:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y^{\prime }+5 y&={\mathrm e}^{-2 x} \sec \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+5*y(x) = exp(-2*x)*sec(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-2 x} \left (-\ln \left (\sec \left (x \right )\right ) \cos \left (x \right )+\cos \left (x \right ) c_{1} +\sin \left (x \right ) \left (x +c_{2} \right )\right ) \]
Mathematica. Time used: 0.051 (sec). Leaf size: 28
ode=D[y[x],{x,2}]+4*D[y[x],x]+5*y[x]==Exp[-2*x]*Sec[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} ((x+c_1) \sin (x)+\cos (x) (\log (\cos (x))+c_2)) \]
Sympy. Time used: 0.423 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) + 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-2*x)/cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\left (C_{1} + x\right ) \sin {\left (x \right )} + \left (C_{2} + \log {\left (\cos {\left (x \right )} \right )}\right ) \cos {\left (x \right )}\right ) e^{- 2 x} \]