9.1.30 problem 30

Internal problem ID [2870]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 5, page 21
Problem number : 30
Date solved : Tuesday, September 30, 2025 at 05:55:50 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.250 (sec). Leaf size: 31
ode:=(x^2-2*x-8)*diff(y(x),x) = y(x)^2+y(x)-2; 
ic:=[y(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {2 x +8-2 \sqrt {-2 x^{2}+4 x +16}}{3 x +4} \]
Mathematica. Time used: 3.599 (sec). Leaf size: 48
ode=(x^2-2*x-8)*D[y[x],x]==y[x]^2+y[x]-2; 
ic=y[0]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {4 \sqrt {x+2}-2 \sqrt {8-2 x}}{\sqrt {8-2 x}+4 \sqrt {x+2}} \end{align*}
Sympy. Time used: 1.527 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x**2 - 2*x - 8)*Derivative(y(x), x) - y(x)**2 - y(x) + 2,0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\frac {3 x}{4} - \frac {3 \sqrt {2} \sqrt {- \left (x - 4\right ) \left (x + 2\right )}}{4} + 3}{\frac {9 x}{8} + \frac {3}{2}} \]