65.4.5 problem 5

Internal problem ID [15664]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.2, page 53
Problem number : 5
Date solved : Thursday, October 02, 2025 at 10:22:21 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=\sqrt {\left (y+2\right ) \left (y-1\right )} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 30
ode:=diff(y(x),x) = ((y(x)+2)*(y(x)-1))^(1/2); 
dsolve(ode,y(x), singsol=all);
 
\[ x +\ln \left (2\right )-\ln \left (1+2 y+2 \sqrt {\left (y+2\right ) \left (y-1\right )}\right )+c_1 = 0 \]
Mathematica. Time used: 0.172 (sec). Leaf size: 41
ode=D[y[x],x]==Sqrt[ (y[x]+2)*(y[x]-1)]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} \left (-e^{-x-c_1}-9 e^{x+c_1}-2\right )\\ y(x)&\to -2\\ y(x)&\to 1 \end{align*}
Sympy. Time used: 0.677 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sqrt((y(x) - 1)*(y(x) + 2)) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {9 e^{- C_{1} - x}}{4} + \frac {e^{C_{1} + x}}{4} - \frac {1}{2} \]