36.6.24 problem 27

Internal problem ID [6385]
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.4. page 449
Problem number : 27
Date solved : Sunday, March 30, 2025 at 10:54:05 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using series method with expansion around

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

Maple. Time used: 0.089 (sec). Leaf size: 69
Order:=6; 
ode:=(-x^2+1)*diff(diff(y(x),x),x)-diff(y(x),x)+y(x) = tan(x); 
dsolve(ode,y(x),type='series',x=0);
 
\[ y = \left (1-\frac {1}{2} x^{2}-\frac {1}{6} x^{3}-\frac {1}{12} x^{4}-\frac {7}{120} x^{5}\right ) y \left (0\right )+\left (x +\frac {1}{2} x^{2}+\frac {1}{24} x^{4}+\frac {1}{120} x^{5}\right ) y^{\prime }\left (0\right )+\frac {x^{3}}{6}+\frac {x^{4}}{24}+\frac {x^{5}}{15}+O\left (x^{6}\right ) \]
Mathematica. Time used: 0.028 (sec). Leaf size: 197
ode=(1-x^2)*D[y[x],{x,2}]-D[y[x],x]+y[x]==Tan[x]; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to c_2 \left (\frac {x^6}{60}+\frac {x^5}{120}+\frac {x^4}{24}+\frac {x^2}{2}+x\right )+c_1 \left (-\frac {7 x^5}{120}-\frac {x^4}{12}-\frac {x^3}{6}-\frac {x^2}{2}+1\right )+\left (-\frac {7 x^5}{120}-\frac {x^4}{12}-\frac {x^3}{6}-\frac {x^2}{2}+1\right ) \left (\frac {7 x^6}{48}-\frac {4 x^5}{15}+\frac {x^4}{8}-\frac {x^3}{3}\right )+\left (\frac {x^6}{60}+\frac {x^5}{120}+\frac {x^4}{24}+\frac {x^2}{2}+x\right ) \left (\frac {67 x^6}{240}-\frac {3 x^5}{10}+\frac {x^4}{3}-\frac {x^3}{3}+\frac {x^2}{2}\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((1 - x**2)*Derivative(y(x), (x, 2)) + y(x) - tan(x) - Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
ValueError : ODE (1 - x**2)*Derivative(y(x), (x, 2)) + y(x) - tan(x) - Derivative(y(x), x) does not match hint 2nd_power_series_regular