47.5.9 problem 9

Internal problem ID [7498]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 2. Linear homogeneous equations. Section 2.3.4 problems. page 104
Problem number : 9
Date solved : Sunday, March 30, 2025 at 12:10:48 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 26
ode:=x*diff(diff(y(x),x),x)+2*diff(y(x),x)+x*y(x) = sec(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\ln \left (\sec \left (x \right )\right ) \cos \left (x \right )+\cos \left (x \right ) c_1 +\sin \left (x \right ) \left (x +c_2 \right )}{x} \]
Mathematica. Time used: 0.094 (sec). Leaf size: 68
ode=x*D[y[x],{x,2}]+2*D[y[x],x]+x*y[x]==Sec[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{-i x} \left (2 e^{2 i x} \text {arctanh}\left (1+2 e^{2 i x}\right )+\log \left (1+e^{2 i x}\right )-i c_2 e^{2 i x}+2 c_1\right )}{2 x} \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x) + x*Derivative(y(x), (x, 2)) + 2*Derivative(y(x), x) - 1/cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE x*y(x)/2 + x*Derivative(y(x), (x, 2))/2 + Derivative(y(x), x) - 1/(2*cos(x)) cannot be solved by the factorable group method