40.11.14 problem 40

Internal problem ID [6748]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 40
Date solved : Sunday, March 30, 2025 at 11:21:19 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)+5*diff(y(x),x)+6*y(x) = exp(-2*x)*sec(x)^2*(1+2*tan(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 +\tan \left (x \right )-1\right ) {\mathrm e}^{-2 x}+{\mathrm e}^{-3 x} c_2 \]
Mathematica. Time used: 0.121 (sec). Leaf size: 26
ode=D[y[x],{x,2}]+5*D[y[x],x]+6*y[x]==Exp[-2*x]*Sec[x]^2*(1+2*Tan[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-3 x} \left (e^x \tan (x)+c_2 e^x+c_1\right ) \]
Sympy. Time used: 3.456 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-2*tan(x) - 1)*exp(-2*x)/cos(x)**2 + 6*y(x) + 5*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \left (C_{2} - \int \frac {\left (2 \tan {\left (x \right )} + 1\right ) e^{x}}{\cos ^{2}{\left (x \right )}}\, dx\right ) e^{- x} + \tan {\left (x \right )} + \frac {1}{\cos ^{2}{\left (x \right )}}\right ) e^{- 2 x} \]