50.18.3 problem 1(c)

Internal problem ID [8097]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 4. Power Series Solutions and Special Functions. Section 4.3. Second-Order Linear Equations: Ordinary Points. Page 169
Problem number : 1(c)
Date solved : Sunday, March 30, 2025 at 12:45:18 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+2 x y^{\prime }-y&=x \end{align*}

Using series method with expansion around

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

Maple. Time used: 0.007 (sec). Leaf size: 64
Order:=8; 
ode:=diff(diff(y(x),x),x)+2*x*diff(y(x),x)-y(x) = x; 
dsolve(ode,y(x),type='series',x=0);
 
\[ y = \left (1+\frac {1}{2} x^{2}-\frac {1}{8} x^{4}+\frac {7}{240} x^{6}\right ) y \left (0\right )+\left (x -\frac {1}{6} x^{3}+\frac {1}{24} x^{5}-\frac {1}{112} x^{7}\right ) y^{\prime }\left (0\right )+\frac {x^{3}}{6}-\frac {x^{5}}{24}+\frac {x^{7}}{112}+O\left (x^{8}\right ) \]
Mathematica. Time used: 0.021 (sec). Leaf size: 77
ode=D[y[x],{x,2}]+2*x*D[y[x],x]-y[x]==x; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,7}]
 
\[ y(x)\to \frac {x^7}{112}-\frac {x^5}{24}+\frac {x^3}{6}+c_2 \left (-\frac {x^7}{112}+\frac {x^5}{24}-\frac {x^3}{6}+x\right )+c_1 \left (\frac {7 x^6}{240}-\frac {x^4}{8}+\frac {x^2}{2}+1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*Derivative(y(x), x) - x - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=8)
 
ValueError : ODE 2*x*Derivative(y(x), x) - x - y(x) + Derivative(y(x), (x, 2)) does not match hint 2nd_power_series_regular