56.1.33 problem 34

Internal problem ID [8745]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 34
Date solved : Sunday, March 30, 2025 at 01:29:30 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,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.917 (sec). Leaf size: 39
ode=D[p[t],t]==a*p[t]-b*p[t]^2; 
ic=p[t0]==p0; 
DSolve[{ode,ic},p[t],t,IncludeSingularSolutions->True]
 
\[ p(t)\to \frac {a \text {p0} e^{a t}}{b \text {p0} \left (e^{a t}-e^{a \text {t0}}\right )+a e^{a \text {t0}}} \]
Sympy. Time used: 0.536 (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 )} \]