12.13.19 problem 22

Internal problem ID [1910]
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 : 22
Date solved : Tuesday, March 04, 2025 at 01:46:03 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using series method with expansion around

\begin{align*} -3 \end{align*}

With initial conditions

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

Maple. Time used: 0.003 (sec). Leaf size: 20
Order:=6; 
ode:=(x+4)*diff(diff(y(x),x),x)-(4+2*x)*diff(y(x),x)+(6+x)*y(x) = 0; 
ic:=y(-3) = 2, D(y)(-3) = -2; 
dsolve([ode,ic],y(x),type='series',x=-3);
 
\[ y = 2-2 \left (x +3\right )-\left (x +3\right )^{2}+\left (x +3\right )^{3}-\frac {11}{12} \left (x +3\right )^{4}+\frac {67}{60} \left (x +3\right )^{5}+\operatorname {O}\left (\left (x +3\right )^{6}\right ) \]
Mathematica. Time used: 0.001 (sec). Leaf size: 40
ode=(4+x)*D[y[x],{x,2}]-(4+2*x)*D[y[x],x]+(6+x)*y[x]==0; 
ic={y[-3]==2,Derivative[1][y][-3 ]==-2}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,-3,5}]
 
\[ y(x)\to \frac {67}{60} (x+3)^5-\frac {11}{12} (x+3)^4+(x+3)^3-(x+3)^2-2 (x+3)+2 \]
Sympy. Time used: 0.866 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x + 4)*Derivative(y(x), (x, 2)) + (x + 6)*y(x) - (2*x + 4)*Derivative(y(x), x),0) 
ics = {y(-3): 2, Subs(Derivative(y(x), x), x, -3): -2} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_ordinary",x0=-3,n=6)
 
\[ y{\left (x \right )} = C_{2} \left (x - \left (x + 3\right )^{4} + \frac {5 \left (x + 3\right )^{3}}{6} - \left (x + 3\right )^{2} + 3\right ) + C_{1} \left (- \frac {35 \left (x + 3\right )^{4}}{24} + \frac {4 \left (x + 3\right )^{3}}{3} - \frac {3 \left (x + 3\right )^{2}}{2} + 1\right ) + O\left (x^{6}\right ) \]