65.5.10 problem 10.5

Internal problem ID [13678]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 10, Two tricks for nonlinear equations. Exercises page 97
Problem number : 10.5
Date solved : Monday, March 31, 2025 at 08:08:40 AM
CAS classification : [_quadrature]

\begin{align*} x^{\prime }&=k x-x^{2} \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 18
ode:=diff(x(t),t) = k*x(t)-x(t)^2; 
dsolve(ode,x(t), singsol=all);
 
\[ x = \frac {k}{1+{\mathrm e}^{-k t} c_1 k} \]
Mathematica. Time used: 0.272 (sec). Leaf size: 42
ode=D[x[t],t]==k*x[t]-x[t]^2; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{(k-K[1]) K[1]}dK[1]\&\right ][t+c_1] \\ x(t)\to 0 \\ x(t)\to k \\ \end{align*}
Sympy. Time used: 0.347 (sec). Leaf size: 19
from sympy import * 
t = symbols("t") 
k = symbols("k") 
x = Function("x") 
ode = Eq(-k*x(t) + x(t)**2 + Derivative(x(t), t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {k e^{k \left (C_{1} + t\right )}}{e^{k \left (C_{1} + t\right )} - 1} \]