29.3.17 problem 71

Internal problem ID [4679]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 3
Problem number : 71
Date solved : Sunday, March 30, 2025 at 03:36:14 AM
CAS classification : [_linear]

\begin{align*} y^{\prime }&=\sin \left (x \right ) \left (2 \sec \left (x \right )^{2}-y\right ) \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(y(x),x) = sin(x)*(2*sec(x)^2-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2 \sec \left (x \right )-2 \,\operatorname {Ei}_{1}\left (\cos \left (x \right )\right ) {\mathrm e}^{\cos \left (x \right )}+{\mathrm e}^{\cos \left (x \right )} c_1 \]
Mathematica. Time used: 0.115 (sec). Leaf size: 28
ode=D[y[x],x]==Sin[x](2 Sec[x]^2-y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 2 e^{\cos (x)} \operatorname {ExpIntegralEi}(-\cos (x))+2 \sec (x)+c_1 e^{\cos (x)} \]
Sympy. Time used: 73.662 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((y(x) - 2/cos(x)**2)*sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \frac {2 \operatorname {E}_{2}\left (\cos {\left (x \right )}\right )}{\cos {\left (x \right )}}\right ) e^{\cos {\left (x \right )}} \]