84.31.9 problem 19.10

Internal problem ID [22307]
Book : Schaums outline series. Differential Equations By Richard Bronson. 1973. McGraw-Hill Inc. ISBN 0-07-008009-7
Section : Chapter 19. Power series solutions about an ordinary point. Solved problems. Page 98
Problem number : 19.10
Date solved : Thursday, October 02, 2025 at 08:37:20 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using series method with expansion around

\begin{align*} 1 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 70
Order:=6; 
ode:=diff(diff(y(x),x),x)+(x-1)*y(x) = exp(x); 
dsolve(ode,y(x),type='series',x=1);
 
\[ y = \left (1-\frac {\left (x -1\right )^{3}}{6}\right ) y \left (1\right )+\left (x -1-\frac {\left (x -1\right )^{4}}{12}\right ) y^{\prime }\left (1\right )+\frac {{\mathrm e} \left (x -1\right )^{2}}{2}+\frac {{\mathrm e} \left (x -1\right )^{3}}{6}+\frac {{\mathrm e} \left (x -1\right )^{4}}{24}-\frac {{\mathrm e} \left (x -1\right )^{5}}{60}+O\left (x^{6}\right ) \]
Mathematica. Time used: 0.008 (sec). Leaf size: 73
ode=D[y[x],{x,2}]+(x-1)*y[x]==Exp[x]; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,1,5}]
 
\[ y(x)\to -\frac {1}{60} e (x-1)^5+\frac {1}{24} e (x-1)^4+\frac {1}{6} e (x-1)^3+\frac {1}{2} e (x-1)^2+c_1 \left (1-\frac {1}{6} (x-1)^3\right )+c_2 \left (-\frac {1}{12} (x-1)^4+x-1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 1)*y(x) - exp(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=1,n=6)
 
ValueError : ODE (x - 1)*y(x) - exp(x) + Derivative(y(x), (x, 2)) does not match hint 2nd_power_series_regular