84.31.8 problem 19.9

Internal problem ID [22306]
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.9
Date solved : Thursday, October 02, 2025 at 08:37:20 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \left (x^{2}+4\right ) y^{\prime \prime }+y x&=x +2 \end{align*}

Using series method with expansion around

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