36.5.7 problem 7

Internal problem ID [6351]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 8, Series solutions of differential equations. Section 8.3. page 443
Problem number : 7
Date solved : Wednesday, March 05, 2025 at 12:36:30 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using series method with expansion around

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

Maple. Time used: 0.104 (sec). Leaf size: 58
Order:=6; 
ode:=sin(x)*diff(diff(y(x),x),x)+y(x)*cos(x) = 0; 
dsolve(ode,y(x),type='series',x=0);
 
\[ y = c_1 x \left (1-\frac {1}{2} x +\frac {1}{12} x^{2}+\frac {1}{48} x^{3}-\frac {3}{320} x^{4}+\frac {19}{9600} x^{5}+\operatorname {O}\left (x^{6}\right )\right )+c_2 \left (\ln \left (x \right ) \left (-x +\frac {1}{2} x^{2}-\frac {1}{12} x^{3}-\frac {1}{48} x^{4}+\frac {3}{320} x^{5}+\operatorname {O}\left (x^{6}\right )\right )+\left (1-\frac {3}{4} x^{2}+\frac {1}{4} x^{3}-\frac {5}{576} x^{4}-\frac {437}{28800} x^{5}+\operatorname {O}\left (x^{6}\right )\right )\right ) \]
Mathematica. Time used: 0.023 (sec). Leaf size: 85
ode=Sin[x]*D[y[x],{x,2}]+Cos[x]*y[x]==0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to c_1 \left (\frac {1}{576} \left (7 x^4+192 x^3-720 x^2+576 x+576\right )-\frac {1}{48} x \left (x^3+4 x^2-24 x+48\right ) \log (x)\right )+c_2 \left (-\frac {3 x^5}{320}+\frac {x^4}{48}+\frac {x^3}{12}-\frac {x^2}{2}+x\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*cos(x) + sin(x)*Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
ValueError : ODE y(x)*cos(x) + sin(x)*Derivative(y(x), (x, 2)) does not match hint 2nd_power_series_regular