78.3.11 problem 2.f

Internal problem ID [21007]
Book : A FIRST COURSE IN DIFFERENTIAL EQUATIONS FOR SCIENTISTS AND ENGINEERS. By Russell Herman. University of North Carolina Wilmington. LibreText. compiled on 06/09/2025
Section : Chapter 4, Series solutions. Problems section 4.9
Problem number : 2.f
Date solved : Friday, October 03, 2025 at 07:49:22 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x y^{\prime \prime }-x y^{\prime }+y&={\mathrm e}^{x} \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 )&=2 \\ \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 18
Order:=5; 
ode:=x*diff(diff(y(x),x),x)-x*diff(y(x),x)+y(x) = exp(x); 
ic:=[y(0) = 1, D(y)(0) = 2]; 
dsolve([ode,op(ic)],y(x),type='series',x=0);
 
\[ y = 1+2 x +\frac {1}{2} x^{2}+\frac {1}{6} x^{3}+\frac {1}{24} x^{4}+\operatorname {O}\left (x^{5}\right ) \]
Mathematica. Time used: 0.026 (sec). Leaf size: 29
ode=x*D[y[x],{x,2}]-x*D[y[x],x]+y[x]==Exp[x]; 
ic={y[0]==1,Derivative[1][y][0] ==2}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,4}]
 
\[ y(x)\to \frac {x^4}{24}+\frac {x^3}{6}+\frac {x^2}{2}+2 x+1 \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*Derivative(y(x), x) + x*Derivative(y(x), (x, 2)) + y(x) - exp(x),0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 0): 2} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
ValueError : ODE -x*Derivative(y(x), x) + x*Derivative(y(x), (x, 2)) + y(x) - exp(x) does not match hint 2nd_power_series_regular