23.1.330 problem 316

Internal problem ID [4937]
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 : 316
Date solved : Tuesday, September 30, 2025 at 09:03:24 AM
CAS classification : [_separable]

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