23.1.20 problem 15

Internal problem ID [4627]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 15
Date solved : Tuesday, September 30, 2025 at 07:37:23 AM
CAS classification : [_linear]

\begin{align*} y^{\prime }&=1-y \cot \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=diff(y(x),x) = 1-y(x)*cot(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\cot \left (x \right )+c_1 \csc \left (x \right ) \]
Mathematica. Time used: 0.022 (sec). Leaf size: 15
ode=D[y[x],x]==1-y[x]*Cot[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\cot (x)+c_1 \csc (x) \end{align*}
Sympy. Time used: 0.354 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)/tan(x) + Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} - \cos {\left (x \right )}}{\sin {\left (x \right )}} \]