75.23.6 problem 729

Internal problem ID [17132]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 18.1 Integration of differential equation in series. Power series. Exercises page 171
Problem number : 729
Date solved : Monday, March 31, 2025 at 03:42:46 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using series method with expansion around

\begin{align*} \pi \end{align*}

With initial conditions

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

Maple. Time used: 0.010 (sec). Leaf size: 35
Order:=6; 
ode:=x*diff(diff(y(x),x),x)+sin(x)*y(x) = x; 
ic:=y(Pi) = 1, D(y)(Pi) = 0; 
dsolve([ode,ic],y(x),type='series',x=Pi);
 
\[ y = 1+\frac {1}{2} \left (x -\pi \right )^{2}+\frac {1}{6} \frac {1}{\pi } \left (x -\pi \right )^{3}-\frac {1}{12} \frac {1}{\pi ^{2}} \left (x -\pi \right )^{4}+\frac {1}{60} \frac {\pi ^{2}+3}{\pi ^{3}} \left (x -\pi \right )^{5}+\operatorname {O}\left (\left (x -\pi \right )^{6}\right ) \]
Mathematica. Time used: 0.016 (sec). Leaf size: 75
ode=x*D[y[x],{x,2}]+Sin[x]*y[x]==x; 
ic={y[Pi]==1,Derivative[1][y][Pi]==0}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,Pi,5}]
 
\[ y(x)\to \frac {1}{60} \left (\frac {3}{2 \pi }-\frac {\pi ^2-6}{2 \pi ^3}\right ) (x-\pi )^5-\frac {(x-\pi )^4}{12 \pi ^2}+\frac {(x-\pi )^3}{6 \pi }+\frac {1}{2} (x-\pi )^2+1 \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), (x, 2)) - x + y(x)*sin(x),0) 
ics = {y(pi): 1, Subs(Derivative(y(x), x), x, pi): 0} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=pi,n=6)
 
ValueError : ODE x*Derivative(y(x), (x, 2)) - x + y(x)*sin(x) does not match hint 2nd_power_series_regular