19.1.18 problem 18

Internal problem ID [4230]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 18
Date solved : Tuesday, September 30, 2025 at 07:07:52 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.120 (sec). Leaf size: 8
ode:=x*cos(y(x))*diff(y(x),x) = 1+sin(y(x)); 
ic:=[y(1) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \arcsin \left (-1+x \right ) \]
Mathematica. Time used: 35.659 (sec). Leaf size: 53
ode=x*Cos[y[x]]*D[y[x],x]==1+Sin[y[x]]; 
ic=y[1]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 \arccos \left (\frac {1}{2} \left (\sqrt {2-x}+\sqrt {x}\right )\right )\\ y(x)&\to 2 \arccos \left (\frac {1}{2} \left (\sqrt {2-x}+\sqrt {x}\right )\right ) \end{align*}
Sympy. Time used: 0.612 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*cos(y(x))*Derivative(y(x), x) - sin(y(x)) - 1,0) 
ics = {y(1): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int \limits ^{y{\left (x \right )}} \frac {\cos {\left (y \right )}}{\cos {\left (y \right )} \tan {\left (y \right )} + 1}\, dy = - \log {\left (x \right )} - \int \limits ^{0} \frac {\cos {\left (y \right )}}{\cos {\left (y \right )} \tan {\left (y \right )} + 1}\, dy \]