18.3.6 problem Problem 16.8

Internal problem ID [3506]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 16, Series solutions of ODEs. Section 16.6 Exercises, page 550
Problem number : Problem 16.8
Date solved : Sunday, March 30, 2025 at 01:45:16 AM
CAS classification : [_Lienard]

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

Using series method with expansion around

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

Maple. Time used: 0.026 (sec). Leaf size: 32
Order:=6; 
ode:=z*diff(diff(y(z),z),z)-2*diff(y(z),z)+z*y(z) = 0; 
dsolve(ode,y(z),type='series',z=0);
 
\[ y = c_1 \,z^{3} \left (1-\frac {1}{10} z^{2}+\frac {1}{280} z^{4}+\operatorname {O}\left (z^{6}\right )\right )+c_2 \left (12+6 z^{2}-\frac {3}{2} z^{4}+\operatorname {O}\left (z^{6}\right )\right ) \]
Mathematica. Time used: 0.01 (sec). Leaf size: 44
ode=z*D[y[z],{z,2}]-2*D[y[z],z]+z*y[z]==0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[z],{z,0,5}]
 
\[ y(z)\to c_1 \left (-\frac {z^4}{8}+\frac {z^2}{2}+1\right )+c_2 \left (\frac {z^7}{280}-\frac {z^5}{10}+z^3\right ) \]
Sympy. Time used: 0.857 (sec). Leaf size: 31
from sympy import * 
z = symbols("z") 
y = Function("y") 
ode = Eq(z*y(z) + z*Derivative(y(z), (z, 2)) - 2*Derivative(y(z), z),0) 
ics = {} 
dsolve(ode,func=y(z),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
\[ y{\left (z \right )} = C_{2} \left (- \frac {z^{4}}{8} + \frac {z^{2}}{2} + 1\right ) + C_{1} z^{3} \left (1 - \frac {z^{2}}{10}\right ) + O\left (z^{6}\right ) \]