46.1.13 problem 19

Internal problem ID [7303]
Book : ADVANCED ENGINEERING MATHEMATICS. ERWIN KREYSZIG, HERBERT KREYSZIG, EDWARD J. NORMINTON. 10th edition. John Wiley USA. 2011
Section : Chapter 5. Series Solutions of ODEs. Special Functions. Problem set 5.1. page 174
Problem number : 19
Date solved : Wednesday, March 05, 2025 at 04:22:56 AM
CAS classification : [_separable]

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

Using series method with expansion around

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

With initial conditions

\begin{align*} y \left (0\right )&=4 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 16
Order:=6; 
ode:=(x-2)*diff(y(x),x) = x*y(x); 
ic:=y(0) = 4; 
dsolve([ode,ic],y(x),type='series',x=0);
 
\[ y = 4-x^{2}-\frac {1}{3} x^{3}+\frac {1}{30} x^{5}+\operatorname {O}\left (x^{6}\right ) \]
Mathematica. Time used: 0.002 (sec). Leaf size: 24
ode=(x-2)*D[y[x],x]==x*y[x]; 
ic={y[0]==4}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to \frac {x^5}{30}-\frac {x^3}{3}-x^2+4 \]
Sympy. Time used: 0.796 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*y(x) + (x - 2)*Derivative(y(x), x),0) 
ics = {y(0): 4} 
dsolve(ode,func=y(x),ics=ics,hint="1st_power_series",x0=0,n=6)
 
\[ y{\left (x \right )} = 4 - x^{2} - \frac {x^{3}}{3} + \frac {x^{5}}{30} + O\left (x^{6}\right ) \]