12.3.25 problem 26

Internal problem ID [1602]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. separable equations. Section 2.2 Page 52
Problem number : 26
Date solved : Saturday, March 29, 2025 at 11:06:50 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (\pi \right )&=\frac {\pi }{2} \end{align*}

Maple. Time used: 0.125 (sec). Leaf size: 11
ode:=diff(y(x),x) = cos(x)/sin(y(x)); 
ic:=y(Pi) = 1/2*Pi; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\pi }{2}+\arcsin \left (\sin \left (x \right )\right ) \]
Mathematica. Time used: 0.403 (sec). Leaf size: 10
ode=D[y[x],x]==Cos[x]/Sin[y[x]]; 
ic=y[Pi]==Pi/2; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \arccos (-\sin (x)) \]
Sympy. Time used: 0.355 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - cos(x)/sin(y(x)),0) 
ics = {y(pi): pi/2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \operatorname {acos}{\left (- \sin {\left (x \right )} \right )} \]