29.3.20 problem 74

Internal problem ID [4682]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 3
Problem number : 74
Date solved : Tuesday, March 04, 2025 at 07:02:37 PM
CAS classification : [_separable]

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

Maple. Time used: 0.006 (sec). Leaf size: 14
ode:=diff(y(x),x)+tan(x)*(1-y(x)^2) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\tanh \left (-\ln \left (\cos \left (x \right )\right )+c_{1} \right ) \]
Mathematica. Time used: 0.618 (sec). Leaf size: 45
ode=D[y[x],x]+Tan[x] (1-y[x]^2)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1-e^{2 c_1} \sec ^2(x)}{1+e^{2 c_1} \sec ^2(x)} \\ y(x)\to -1 \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.649 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((1 - y(x)**2)*tan(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \cos ^{2}{\left (x \right )}}{- C_{1} + \cos ^{2}{\left (x \right )}} \]