30.5.20 problem 20

Internal problem ID [7519]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.6, Substitutions and Transformations. Exercises. page 76
Problem number : 20
Date solved : Tuesday, September 30, 2025 at 04:41:47 PM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

\begin{align*} y^{\prime }&=\sin \left (x -y\right ) \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 23
ode:=diff(y(x),x) = sin(x-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x -2 \arctan \left (\frac {c_1 -x +2}{c_1 -x}\right ) \]
Mathematica. Time used: 0.224 (sec). Leaf size: 64
ode=D[y[x],x]==Sin[x-y[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [y(x)-\sec (x-y(x)) \left (2 \sqrt {\cos ^2(x-y(x))} \arcsin \left (\frac {\sqrt {1-\sin (x-y(x))}}{\sqrt {2}}\right )+\sin (x-y(x))+1\right )=c_1,y(x)\right ] \]
Sympy. Time used: 1.041 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sin(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 {C_{1} + x - 2}{C_{1} + x} \right )} \]