23.1.319 problem 307

Internal problem ID [4926]
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 : 307
Date solved : Tuesday, September 30, 2025 at 09:00:28 AM
CAS classification : [_rational, _Bernoulli]

\begin{align*} \left (-x^{2}+4\right ) y^{\prime }+4 y&=\left (2+x \right ) y^{2} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 21
ode:=(-x^2+4)*diff(y(x),x)+4*y(x) = (x+2)*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x -2}{\left (\ln \left (2+x \right )+c_1 \right ) \left (2+x \right )} \]
Mathematica. Time used: 0.181 (sec). Leaf size: 72
ode=(4-x^2)*D[y[x],x]+4*y[x]==(2+x)*y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\exp \left (\int _1^x\frac {4}{K[1]^2-4}dK[1]\right )}{-\int _1^x-\frac {\exp \left (\int _1^{K[2]}\frac {4}{K[1]^2-4}dK[1]\right )}{K[2]-2}dK[2]+c_1}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.189 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((4 - x**2)*Derivative(y(x), x) - (x + 2)*y(x)**2 + 4*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x - 2}{C_{1} x + 2 C_{1} + x \log {\left (x + 2 \right )} + 2 \log {\left (x + 2 \right )}} \]