69.20.20 problem 659

Internal problem ID [18441]
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 15.5 Linear equations with variable coefficients. The Lagrange method. Exercises page 148
Problem number : 659
Date solved : Thursday, October 02, 2025 at 03:11:58 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\frac {2}{\sin \left (x \right )^{3}} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+y(x) = 2/sin(x)^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 +2 \cot \left (x \right )\right ) \cos \left (x \right )+\sin \left (x \right ) c_2 -\csc \left (x \right ) \]
Mathematica. Time used: 0.019 (sec). Leaf size: 37
ode=D[y[x],{x,2}]+y[x]==2/Sin[x]^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \cos (x) \int _1^x-2 \csc ^2(K[1])dK[1]-\csc (x)+c_1 \cos (x)+c_2 \sin (x) \end{align*}
Sympy. Time used: 0.154 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 2/sin(x)**3,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} + \frac {1}{\sin {\left (x \right )}} \]