71.4.5 problem 5

Internal problem ID [14298]
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 : Wednesday, March 05, 2025 at 10:43:27 PM
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) = ((2+y(x))*(-1+y(x)))^(1/2); 
dsolve(ode,y(x), singsol=all);
 
\[ x +\ln \left (2\right )-\ln \left (2 y+1+2 \sqrt {\left (y+2\right ) \left (y-1\right )}\right )+c_{1} = 0 \]
Mathematica. Time used: 0.271 (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: 1.059 (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} \]