71.8.29 problem 10 (c)

Internal problem ID [14392]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.4.4, page 115
Problem number : 10 (c)
Date solved : Monday, March 31, 2025 at 12:23:04 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=\sqrt {\left (y+2\right ) \left (y-1\right )} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=-3 \end{align*}

Maple. Time used: 0.155 (sec). Leaf size: 16
ode:=diff(y(x),x) = ((2+y(x))*(-1+y(x)))^(1/2); 
ic:=y(0) = -3; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{x}}{4}-\frac {1}{2}-\frac {9 \,{\mathrm e}^{-x}}{4} \]
Mathematica. Time used: 0.012 (sec). Leaf size: 23
ode=D[y[x],x]==Sqrt[ (y[x]+2)*( y[x]-1)]; 
ic={y[0]==-3}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} \left (-9 e^{-x}-e^x-2\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sqrt((y(x) - 1)*(y(x) + 2)) + Derivative(y(x), x),0) 
ics = {y(0): -3} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : Initial conditions produced too many solutions for constants