58.12.8 problem 8

Internal problem ID [14793]
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 : 8
Date solved : Thursday, October 02, 2025 at 09:54:57 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }+5 y&={\mathrm e}^{x} \tan \left (2 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 36
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+5*y(x) = exp(x)*tan(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (c_2 \sin \left (2 x \right )+c_1 \cos \left (2 x \right )-\frac {\cos \left (2 x \right ) \ln \left (\sec \left (2 x \right )+\tan \left (2 x \right )\right )}{4}\right ) \]
Mathematica. Time used: 0.038 (sec). Leaf size: 42
ode=D[y[x],{x,2}]-2*D[y[x],x]+5*y[x]==Exp[x]*Tan[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{4} e^x (\cos (2 x) \text {arctanh}(\sin (2 x))-4 c_2 \cos (2 x)+(1-4 c_1) \sin (2 x)) \end{align*}
Sympy. Time used: 0.379 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) - exp(x)*tan(2*x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{2} \sin {\left (2 x \right )} + \left (C_{1} + \frac {\log {\left (\sin {\left (2 x \right )} - 1 \right )}}{8} - \frac {\log {\left (\sin {\left (2 x \right )} + 1 \right )}}{8}\right ) \cos {\left (2 x \right )}\right ) e^{x} \]