69.20.19 problem 658

Internal problem ID [18440]
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 : 658
Date solved : Thursday, October 02, 2025 at 03:11:57 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y^{\prime }+2 y&=\frac {{\mathrm e}^{-x}}{\sin \left (x \right )} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+2*y(x) = 1/exp(x)/sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\left (-\ln \left (\sin \left (x \right )\right ) \sin \left (x \right )+\left (x -c_1 \right ) \cos \left (x \right )-c_2 \sin \left (x \right )\right ) {\mathrm e}^{-x} \]
Mathematica. Time used: 0.028 (sec). Leaf size: 30
ode=D[y[x],{x,2}]+2*D[y[x],x]+2*y[x]==1/(Exp[x]*Sin[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} ((-x+c_2) \cos (x)+\sin (x) (\log (\sin (x))+c_1)) \end{align*}
Sympy. Time used: 0.259 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-x)/sin(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\left (C_{1} - x\right ) \cos {\left (x \right )} + \left (C_{2} + \log {\left (\sin {\left (x \right )} \right )}\right ) \sin {\left (x \right )}\right ) e^{- x} \]