10.4.9 problem 11

Internal problem ID [1190]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.5. Page 88
Problem number : 11
Date solved : Saturday, March 29, 2025 at 10:45:21 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=-b \sqrt {y}+a y \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 26
ode:=diff(y(t),t) = -b*y(t)^(1/2)+a*y(t); 
dsolve(ode,y(t), singsol=all);
 
\[ \frac {-{\mathrm e}^{\frac {a t}{2}} c_1 a +\sqrt {y}\, a -b}{a} = 0 \]
Mathematica. Time used: 0.705 (sec). Leaf size: 55
ode=D[y[t],t] == -b*y[t]^(1/2)+a*y[t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to \frac {e^{-a c_1} \left (e^{\frac {a t}{2}}-b e^{\frac {a c_1}{2}}\right ){}^2}{a^2} \\ y(t)\to 0 \\ y(t)\to \frac {b^2}{a^2} \\ \end{align*}
Sympy. Time used: 0.635 (sec). Leaf size: 65
from sympy import * 
t = symbols("t") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*y(t) + b*sqrt(y(t)) + Derivative(y(t), t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ \left [ y{\left (t \right )} = \begin {cases} \frac {C_{1}^{2} b^{2}}{4} - \frac {C_{1} b^{2} t}{2} + \frac {b^{2} t^{2}}{4} & \text {for}\: a = 0 \\\text {NaN} & \text {otherwise} \end {cases}, \ y{\left (t \right )} = \begin {cases} e^{- C_{1} a + a t} + \frac {2 b e^{- \frac {C_{1} a}{2} + \frac {a t}{2}}}{a} + \frac {b^{2}}{a^{2}} & \text {for}\: a \neq 0 \\\text {NaN} & \text {otherwise} \end {cases}\right ] \]