20.2.8 problem Problem 8

Internal problem ID [3600]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.4, Separable Differential Equations. page 43
Problem number : Problem 8
Date solved : Tuesday, March 04, 2025 at 04:54:21 PM
CAS classification : [_separable]

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

Maple. Time used: 0.204 (sec). Leaf size: 11
ode:=diff(y(x),x) = cos(x-y(x))/sin(x)/sin(y(x))-1; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \arccos \left (\frac {\csc \left (x \right )}{c_{1}}\right ) \]
Mathematica. Time used: 5.816 (sec). Leaf size: 47
ode=D[y[x],x]==Cos[x-y[x]]/(Sin[x]*Sin[y[x]])-1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\arccos \left (-\frac {1}{2} c_1 \csc (x)\right ) \\ y(x)\to \arccos \left (-\frac {1}{2} c_1 \csc (x)\right ) \\ y(x)\to -\frac {\pi }{2} \\ y(x)\to \frac {\pi }{2} \\ \end{align*}
Sympy. Time used: 0.511 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + 1 - cos(x - y(x))/(sin(x)*sin(y(x))),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \operatorname {acos}{\left (\frac {C_{1}}{\sin {\left (x \right )}} \right )} + 2 \pi , \ y{\left (x \right )} = \operatorname {acos}{\left (\frac {C_{1}}{\sin {\left (x \right )}} \right )}\right ] \]