25.1.19 problem 19

Internal problem ID [4231]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 19
Date solved : Tuesday, March 04, 2025 at 05:57:04 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (\frac {1}{2}\right )&=2 \end{align*}

Maple. Time used: 0.038 (sec). Leaf size: 15
ode:=x*diff(y(x),x) = 2*y(x)*(-1+y(x)); 
ic:=y(1/2) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = -\frac {1}{2 x^{2}-1} \]
Mathematica. Time used: 0.316 (sec). Leaf size: 14
ode=x*D[y[x],x]==2*y[x]*(y[x]-1); 
ic=y[1/2]==2; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{1-2 x^2} \]
Sympy. Time used: 0.303 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - (2*y(x) - 2)*y(x),0) 
ics = {y(1/2): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {1}{2 x^{2} - 1} \]