12.13.30 problem 31(d)

Internal problem ID [1921]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 7 Series Solutions of Linear Second Equations. 7.3 SERIES SOLUTIONS NEAR AN ORDINARY POINT II. Exercises 7.3. Page 338
Problem number : 31(d)
Date solved : Saturday, March 29, 2025 at 11:43:15 PM
CAS classification : [[_2nd_order, _exact, _linear, _homogeneous]]

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

Using series method with expansion around

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

Maple. Time used: 0.008 (sec). Leaf size: 59
Order:=6; 
ode:=(x^2+4*x+4)*diff(diff(y(x),x),x)+(8+4*x)*diff(y(x),x)+2*y(x) = 0; 
dsolve(ode,y(x),type='series',x=0);
 
\[ y = \left (1-\frac {1}{4} x^{2}+\frac {1}{4} x^{3}-\frac {3}{16} x^{4}+\frac {1}{8} x^{5}\right ) y \left (0\right )+\left (x -x^{2}+\frac {3}{4} x^{3}-\frac {1}{2} x^{4}+\frac {5}{16} x^{5}\right ) y^{\prime }\left (0\right )+O\left (x^{6}\right ) \]
Mathematica. Time used: 0.002 (sec). Leaf size: 68
ode=(4+4*x+x^2)*D[y[x],{x,2}]+(8+4*x)*D[y[x],x]+2*y[x]==0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to c_1 \left (\frac {x^5}{8}-\frac {3 x^4}{16}+\frac {x^3}{4}-\frac {x^2}{4}+1\right )+c_2 \left (\frac {5 x^5}{16}-\frac {x^4}{2}+\frac {3 x^3}{4}-x^2+x\right ) \]
Sympy. Time used: 0.794 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((4*x + 8)*Derivative(y(x), x) + (x**2 + 4*x + 4)*Derivative(y(x), (x, 2)) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_ordinary",x0=0,n=6)
 
\[ y{\left (x \right )} = C_{2} \left (- \frac {3 x^{4}}{16} + \frac {x^{3}}{4} - \frac {x^{2}}{4} + 1\right ) + C_{1} x \left (- \frac {x^{3}}{2} + \frac {3 x^{2}}{4} - x + 1\right ) + O\left (x^{6}\right ) \]