62.30.5 problem Ex 5

Internal problem ID [12898]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter VIII, Linear differential equations of the second order. Article 53. Change of dependent variable. Page 125
Problem number : Ex 5
Date solved : Monday, March 31, 2025 at 07:23:56 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \sin \left (x \right ) y^{\prime \prime }+2 \cos \left (x \right ) y^{\prime }+3 \sin \left (x \right ) y&={\mathrm e}^{x} \end{align*}

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