29.11.22 problem 313

Internal problem ID [4913]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 11
Problem number : 313
Date solved : Tuesday, March 04, 2025 at 07:29:38 PM
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 \left (x \right ) = \frac {c_{1} x}{\left (x +1\right )^{3}} \]
Mathematica. Time used: 0.037 (sec). Leaf size: 19
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 \frac {c_1 x}{(x+1)^3} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.248 (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} \]