12.11.8 problem 18

Internal problem ID [1847]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 7 Series Solutions of Linear Second Equations. 7.1 Exercises. Page 318
Problem number : 18
Date solved : Tuesday, March 04, 2025 at 01:44:59 PM
CAS classification : [[_Emden, _Fowler]]

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

Using series method with expansion around

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

With initial conditions

\begin{align*} y \left (0\right )&=a_{0}\\ y^{\prime }\left (0\right )&=a_{1} \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 40
Order:=6; 
ode:=(2-x)*diff(diff(y(x),x),x)+2*y(x) = 0; 
ic:=y(0) = a__0, D(y)(0) = a__1; 
dsolve([ode,ic],y(x),type='series',x=0);
 
\[ y = a_{0} +a_{1} x -\frac {1}{2} a_{0} x^{2}+\left (-\frac {a_{1}}{6}-\frac {a_{0}}{12}\right ) x^{3}+\left (\frac {a_{0}}{48}-\frac {a_{1}}{24}\right ) x^{4}+\left (-\frac {a_{1}}{240}+\frac {a_{0}}{96}\right ) x^{5}+\operatorname {O}\left (x^{6}\right ) \]
Mathematica. Time used: 0.001 (sec). Leaf size: 79
ode=(2-x)*D[y[x],{x,2}]+2*y[x]==0; 
ic={y[0]==a0,Derivative[1][y][0] ==a1}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to \frac {1}{20} x^5 \left (\frac {1}{6} \left (\frac {\text {a0}}{2}+\text {a1}\right )+\frac {\text {a0}}{8}-\frac {\text {a1}}{4}\right )+\frac {1}{12} x^4 \left (\frac {\text {a0}}{4}-\frac {\text {a1}}{2}\right )+\frac {1}{6} x^3 \left (-\frac {\text {a0}}{2}-\text {a1}\right )-\frac {\text {a0} x^2}{2}+\text {a0}+\text {a1} x \]
Sympy. Time used: 0.816 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2 - x)*Derivative(y(x), (x, 2)) + 2*y(x),0) 
ics = {y(0): a__0, Subs(Derivative(y(x), x), x, 0): a__1} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_ordinary",x0=0,n=6)
 
\[ y{\left (x \right )} = C_{2} \left (\frac {x^{4}}{48} - \frac {x^{3}}{12} - \frac {x^{2}}{2} + 1\right ) + C_{1} x \left (- \frac {x^{3}}{24} - \frac {x^{2}}{6} + 1\right ) + O\left (x^{6}\right ) \]