50.1.33 problem 34

Internal problem ID [10031]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 34
Date solved : Tuesday, September 30, 2025 at 06:47:07 PM
CAS classification : [_quadrature]

\begin{align*} p^{\prime }&=a p-b p^{2} \end{align*}

With initial conditions

\begin{align*} p \left (\operatorname {t0} \right )&=\operatorname {p0} \\ \end{align*}
Maple. Time used: 0.066 (sec). Leaf size: 29
ode:=diff(p(t),t) = a*p(t)-b*p(t)^2; 
ic:=[p(t0) = p0]; 
dsolve([ode,op(ic)],p(t), singsol=all);
 
\[ p = \frac {a \operatorname {p0}}{\left (-\operatorname {p0} b +a \right ) {\mathrm e}^{-a \left (t -\operatorname {t0} \right )}+\operatorname {p0} b} \]
Mathematica. Time used: 0.167 (sec). Leaf size: 55
ode=D[p[t],t]==a*p[t]-b*p[t]^2; 
ic=p[t0]==p0; 
DSolve[{ode,ic},p[t],t,IncludeSingularSolutions->True]
 
\begin{align*} p(t)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{K[1] (a-b K[1])}dK[1]\&\right ]\left [\int _1^{\text {p0}}\frac {1}{a K[1]-b K[1]^2}dK[1]+t-\text {t0}\right ] \end{align*}
Sympy. Time used: 0.356 (sec). Leaf size: 51
from sympy import * 
t = symbols("t") 
a = symbols("a") 
b = symbols("b") 
p = Function("p") 
ode = Eq(-a*p(t) + b*p(t)**2 + Derivative(p(t), t),0) 
ics = {p(t0): p0} 
dsolve(ode,func=p(t),ics=ics)
 
\[ p{\left (t \right )} = \frac {a e^{a \left (t + \frac {\log {\left (\frac {b p_{0} e^{- a t_{0}}}{- a + b p_{0}} \right )}}{a}\right )}}{b \left (e^{a \left (t + \frac {\log {\left (\frac {b p_{0} e^{- a t_{0}}}{- a + b p_{0}} \right )}}{a}\right )} - 1\right )} \]