21.1.2 problem 2

Internal problem ID [4078]
Book : Differential equations, Shepley L. Ross, 1964
Section : 2.4, page 55
Problem number : 2
Date solved : Sunday, March 30, 2025 at 02:16:29 AM
CAS classification : [[_1st_order, _with_exponential_symmetries]]

\begin{align*} 2 x \tan \left (y\right )+\left (x -x^{2} \tan \left (y\right )\right ) y^{\prime }&=0 \end{align*}

Maple. Time used: 0.085 (sec). Leaf size: 28
ode:=2*x*tan(y(x))+(x-x^2*tan(y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ x -\left (-\frac {\int _{}^{y}{\mathrm e}^{-\frac {\textit {\_a}}{2}} \cot \left (\textit {\_a} \right )d \textit {\_a}}{2}+c_1 \right ) {\mathrm e}^{\frac {y}{2}} = 0 \]
Mathematica. Time used: 0.419 (sec). Leaf size: 78
ode=(2*x*Tan[y[x]])+(x-x^2*Tan[y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\frac {1}{34} \left ((8-2 i) e^{2 i y(x)} \operatorname {Hypergeometric2F1}\left (1,1+\frac {i}{4},2+\frac {i}{4},e^{2 i y(x)}\right )-34 i \operatorname {Hypergeometric2F1}\left (\frac {i}{4},1,1+\frac {i}{4},e^{2 i y(x)}\right )\right )+c_1 e^{\frac {y(x)}{2}},y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*tan(y(x)) + (-x**2*tan(y(x)) + x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : NoneType object is not subscriptable