83.49.5 problem Ex 5 page 122

Internal problem ID [19547]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Book Solved Excercises. Chapter VIII. Linear equations of second order
Problem number : Ex 5 page 122
Date solved : Monday, March 31, 2025 at 07:32:58 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-\cot \left (x \right ) y^{\prime }-\left (1-\cot \left (x \right )\right ) y&={\mathrm e}^{x} \sin \left (x \right ) \end{align*}

Maple. Time used: 0.011 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)-cot(x)*diff(y(x),x)-(1-cot(x))*y(x) = exp(x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (c_2 \left (\cos \left (x \right )+2 \sin \left (x \right )\right ) {\mathrm e}^{-2 x}+c_1 -\frac {\cos \left (x \right )}{2}\right ) \]
Mathematica. Time used: 0.814 (sec). Leaf size: 52
ode=D[y[x],{x,2}]-Cot[x]*D[y[x],x]-(1-Cot[x])*y[x]==Exp[x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{10} e^{-x} \left (10 c_1 e^{2 x}-\left (5 e^{2 x}+2 c_2\right ) \cos \left (\log \left (e^x\right )\right )-4 c_2 \sin \left (\log \left (e^x\right )\right )\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-1 + 1/tan(x))*y(x) - exp(x)*sin(x) + Derivative(y(x), (x, 2)) - Derivative(y(x), x)/tan(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE y(x)*tan(x) - y(x) + exp(x)*sin(x)*tan(x) - tan(x)*Derivative(y(x), (x, 2)) + Derivative(y(x), x) cannot be solved by the factorable group method