29.1.15 problem 14

Internal problem ID [4622]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 1
Problem number : 14
Date solved : Tuesday, March 04, 2025 at 06:56:58 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }&=1-y \cot \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 13
ode:=diff(y(x),x) = 1-y(x)*cot(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\cot \left (x \right )+\csc \left (x \right ) c_{1} \]
Mathematica. Time used: 0.036 (sec). Leaf size: 15
ode=D[y[x],x]==1-y[x]*Cot[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\cot (x)+c_1 \csc (x) \]
Sympy. Time used: 0.602 (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 )}} \]