7.2.13 problem 15

Internal problem ID [31]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.3. Problems at page 27
Problem number : 15
Date solved : Tuesday, March 04, 2025 at 10:39:12 AM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

\begin{align*} y^{\prime }&=\sqrt {x -y} \end{align*}

With initial conditions

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

Maple. Time used: 0.771 (sec). Leaf size: 49
ode:=diff(y(x),x) = (x-y(x))^(1/2); 
ic:=y(2) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \operatorname {RootOf}\left (x +\ln \left (x -\textit {\_Z} -1\right )+2 \sqrt {x -\textit {\_Z}}+\ln \left (\sqrt {x -\textit {\_Z}}-1\right )-\ln \left (1+\sqrt {x -\textit {\_Z}}\right )-2 i \pi -2\right ) \]
Mathematica
ode=D[y[x],x]==Sqrt[x-y[x]]; 
ic={y[2]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

{}

Sympy. Time used: 0.858 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sqrt(x - y(x)) + Derivative(y(x), x),0) 
ics = {y(2): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x + 2 \sqrt {x - y{\left (x \right )}} + 2 \log {\left (\sqrt {x - y{\left (x \right )}} - 1 \right )} - 2 - 2 i \pi = 0 \]