49.21.7 problem 3(a)

Internal problem ID [7737]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 5. Existence and uniqueness of solutions to first order equations. Page 190
Problem number : 3(a)
Date solved : Sunday, March 30, 2025 at 12:20:32 PM
CAS classification : [_quadrature]

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

With initial conditions

\begin{align*} y \left (x_{0} \right )&=y_{0} \end{align*}

Maple. Time used: 0.103 (sec). Leaf size: 27
ode:=diff(y(x),x) = 2*y(x)^(1/2); 
ic:=y(x__0) = y__0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (2 x -2 x_{0} \right ) \sqrt {y_{0}}+x^{2}-2 x x_{0} +x_{0}^{2}+y_{0} \]
Mathematica. Time used: 0.116 (sec). Leaf size: 33
ode=D[y[x],x]==2*Sqrt[y[x]]; 
ic={y[x0]==y0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \left (x-\text {x0}+\sqrt {\text {y0}}\right )^2 \\ y(x)\to \left (-x+\text {x0}+\sqrt {\text {y0}}\right )^2 \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*sqrt(y(x)) + Derivative(y(x), x),0) 
ics = {y(x__0): y__0} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : Initial conditions produced too many solutions for constants