75.20.27 problem 666

Internal problem ID [17090]
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 : 666
Date solved : Monday, March 31, 2025 at 03:40:28 PM
CAS classification : [[_2nd_order, _missing_y]]

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

Maple. Time used: 0.002 (sec). Leaf size: 15
ode:=diff(diff(y(x),x),x)+tan(x)*diff(y(x),x) = cos(x)*cot(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_2 +\sin \left (x \right ) \left (-1+\ln \left (\sin \left (x \right )\right )+c_1 \right ) \]
Mathematica. Time used: 0.352 (sec). Leaf size: 287
ode=D[y[x],{x,2}]+Tan[x]*D[y[x],x]==Cos[x]*Cot[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \exp \left (\int _1^{\cos (x)}-\frac {1}{2 K[1]-2 K[1]^3}dK[1]-\frac {1}{2} \int _1^{\cos (x)}\frac {1}{K[2] \left (K[2]^2-1\right )}dK[2]\right ) \left (\int _1^{\cos (x)}-\frac {\exp \left (\int _1^{K[4]}-\frac {1}{2 K[1]-2 K[1]^3}dK[1]+\frac {1}{2} \int _1^{K[4]}\frac {1}{K[2] \left (K[2]^2-1\right )}dK[2]\right ) K[4]^2 \int _1^{K[4]}\exp \left (-2 \int _1^{K[3]}-\frac {1}{2 K[1]-2 K[1]^3}dK[1]\right )dK[3]}{\left (1-K[4]^2\right )^{3/2}}dK[4]+\int _1^{\cos (x)}\exp \left (-2 \int _1^{K[3]}-\frac {1}{2 K[1]-2 K[1]^3}dK[1]\right )dK[3] \left (\int _1^{\cos (x)}\frac {\exp \left (\int _1^{K[5]}-\frac {1}{2 K[1]-2 K[1]^3}dK[1]+\frac {1}{2} \int _1^{K[5]}\frac {1}{K[2] \left (K[2]^2-1\right )}dK[2]\right ) K[5]^2}{\left (1-K[5]^2\right )^{3/2}}dK[5]+c_2\right )+c_1\right ) \]
Sympy. Time used: 4.150 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-cos(x)/tan(x) + tan(x)*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{2} \sin {\left (x \right )} + \log {\left (\sin {\left (x \right )} \right )} \sin {\left (x \right )} + \log {\left (\cos {\left (x \right )} \right )} \sin {\left (x \right )} - \frac {\log {\left (- \cos ^{2}{\left (x \right )} \right )} \sin {\left (x \right )}}{2} - \sin {\left (x \right )} \]