83.40.2 problem 2

Internal problem ID [19403]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter VIII. Linear equations of second order. Excercise VIII (E) at page 140
Problem number : 2
Date solved : Monday, March 31, 2025 at 07:12:42 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)+y(x) = csc(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\ln \left (\csc \left (x \right )\right ) \sin \left (x \right )+\left (c_1 -x \right ) \cos \left (x \right )+\sin \left (x \right ) c_2 \]
Mathematica. Time used: 0.018 (sec). Leaf size: 24
ode=D[y[x],{x,2}]+y[x]==Csc[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (-x+c_1) \cos (x)+\sin (x) (\log (\sin (x))+c_2) \]
Sympy. Time used: 0.214 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 1/sin(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - x\right ) \cos {\left (x \right )} + \left (C_{2} + \log {\left (\sin {\left (x \right )} \right )}\right ) \sin {\left (x \right )} \]