35.4.11 problem 11

Internal problem ID [6129]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 4. OTHER METHODS FOR FIRST-ORDER EQUATIONS. page 406
Problem number : 11
Date solved : Sunday, March 30, 2025 at 10:40:40 AM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

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

Maple. Time used: 0.012 (sec). Leaf size: 16
ode:=diff(y(x),x) = cos(x+y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x -2 \arctan \left (-x +c_1 \right ) \]
Mathematica. Time used: 25.963 (sec). Leaf size: 163
ode=D[y[x],x]==Cos[x+y[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\arccos \left (\frac {4 (2 x-2 i+c_1) \sin (x)-\left (4 x^2+4 (c_1-2 i) x-8+c_1{}^2-4 i c_1\right ) \cos (x)}{(2 x+c_1) (2 x-4 i+c_1)}\right ) \\ y(x)\to \arccos \left (\frac {4 (2 x-2 i+c_1) \sin (x)-\left (4 x^2+4 (c_1-2 i) x-8+c_1{}^2-4 i c_1\right ) \cos (x)}{(2 x+c_1) (2 x-4 i+c_1)}\right ) \\ y(x)\to \pi -\arccos (\cos (x)) \\ y(x)\to \arccos (\cos (x))-\pi \\ \end{align*}
Sympy. Time used: 0.831 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-cos(x + y(x)) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - x + 2 \operatorname {atan}{\left (C_{1} + x \right )} \]