23.1.66 problem 60

Internal problem ID [4673]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 60
Date solved : Tuesday, September 30, 2025 at 07:57:57 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=a_{0} +a_{1} y+a_{2} y^{2} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 44
ode:=diff(y(x),x) = a__0+a__1*y(x)+a__2*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-a_{1} +\tan \left (\frac {\sqrt {4 a_{0} a_{2} -a_{1}^{2}}\, \left (c_1 +x \right )}{2}\right ) \sqrt {4 a_{0} a_{2} -a_{1}^{2}}}{2 a_{2}} \]
Mathematica. Time used: 21.145 (sec). Leaf size: 106
ode=D[y[x],x]==a0+a1*y[x]+ a2*y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {-\text {a1}+\sqrt {4 \text {a0} \text {a2}-\text {a1}^2} \tan \left (\frac {1}{2} (x+c_1) \sqrt {4 \text {a0} \text {a2}-\text {a1}^2}\right )}{2 \text {a2}}\\ y(x)&\to \frac {\sqrt {\text {a1}^2-4 \text {a0} \text {a2}}-\text {a1}}{2 \text {a2}}\\ y(x)&\to -\frac {\sqrt {\text {a1}^2-4 \text {a0} \text {a2}}+\text {a1}}{2 \text {a2}} \end{align*}
Sympy. Time used: 1.004 (sec). Leaf size: 131
from sympy import * 
x = symbols("x") 
a0 = symbols("a0") 
a1 = symbols("a1") 
a2 = symbols("a2") 
y = Function("y") 
ode = Eq(-a0 - a1*y(x) - a2*y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x + \sqrt {- \frac {1}{4 a_{0} a_{2} - a_{1}^{2}}} \log {\left (y{\left (x \right )} + \frac {- 4 a_{0} a_{2} \sqrt {- \frac {1}{4 a_{0} a_{2} - a_{1}^{2}}} + a_{1}^{2} \sqrt {- \frac {1}{4 a_{0} a_{2} - a_{1}^{2}}} + a_{1}}{2 a_{2}} \right )} - \sqrt {- \frac {1}{4 a_{0} a_{2} - a_{1}^{2}}} \log {\left (y{\left (x \right )} + \frac {4 a_{0} a_{2} \sqrt {- \frac {1}{4 a_{0} a_{2} - a_{1}^{2}}} - a_{1}^{2} \sqrt {- \frac {1}{4 a_{0} a_{2} - a_{1}^{2}}} + a_{1}}{2 a_{2}} \right )} = C_{1} \]