47.1.26 problem 26

Internal problem ID [7407]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 1. First order differential equations. Section 1.1 Separable equations problems. page 7
Problem number : 26
Date solved : Sunday, March 30, 2025 at 11:57:53 AM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

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

Maple. Time used: 0.012 (sec). Leaf size: 14
ode:=diff(y(x),x) = cos(x-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x -2 \,\operatorname {arccot}\left (-x +c_1 \right ) \]
Mathematica. Time used: 5.086 (sec). Leaf size: 55
ode=D[y[x],x]==Cos[y[x]-x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -i \log \left (\frac {e^{i x} (2 x-c_1)}{2 x-4 i-c_1}\right ) \\ y(x)\to -i \log \left (e^{i x}\right ) \\ \end{align*}
Sympy. Time used: 1.067 (sec). Leaf size: 12
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 (\frac {1}{C_{1} + x} \right )} \]