30.14.17 problem 19

Internal problem ID [7666]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 8, Series solutions of differential equations. Section 8.4. page 449
Problem number : 19
Date solved : Tuesday, September 30, 2025 at 04:55:40 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using series method with expansion around

\begin{align*} 0 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=-1 \\ y^{\prime }\left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.009 (sec). Leaf size: 20
Order:=6; 
ode:=diff(diff(y(x),x),x)-exp(2*x)*diff(y(x),x)+y(x)*cos(x) = 0; 
ic:=[y(0) = -1, D(y)(0) = 1]; 
dsolve([ode,op(ic)],y(x),type='series',x=0);
 
\[ y = -1+x +x^{2}+\frac {1}{2} x^{3}+\frac {1}{2} x^{4}+\frac {31}{60} x^{5}+\operatorname {O}\left (x^{6}\right ) \]
Mathematica. Time used: 0.001 (sec). Leaf size: 30
ode=D[y[x],{x,2}]-Exp[2*x]*D[y[x],x]+Cos[x]*y[x]==0; 
ic={y[0]==-1,Derivative[1][y][0] ==1}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to \frac {31 x^5}{60}+\frac {x^4}{2}+\frac {x^3}{2}+x^2+x-1 \]
Sympy. Time used: 0.675 (sec). Leaf size: 110
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*cos(x) - exp(2*x)*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): -1, Subs(Derivative(y(x), x), x, 0): 1} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_ordinary",x0=0,n=6)
 
\[ y{\left (x \right )} = C_{2} \left (- \frac {x^{4} e^{4 x} \cos {\left (x \right )}}{24} + \frac {x^{4} \cos ^{2}{\left (x \right )}}{24} - \frac {x^{3} e^{2 x} \cos {\left (x \right )}}{6} - \frac {x^{2} \cos {\left (x \right )}}{2} + 1\right ) + C_{1} x \left (\frac {x^{3} e^{6 x}}{24} - \frac {x^{3} e^{2 x} \cos {\left (x \right )}}{12} + \frac {x^{2} e^{4 x}}{6} - \frac {x^{2} \cos {\left (x \right )}}{6} + \frac {x e^{2 x}}{2} + 1\right ) + O\left (x^{6}\right ) \]