86.3.16 problem 14

Internal problem ID [23107]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 4. Linear equations of the first order. Exercise 4a at page 56
Problem number : 14
Date solved : Thursday, October 02, 2025 at 09:22:02 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} n^{\prime }&=k n-b t \end{align*}

With initial conditions

\begin{align*} n \left (0\right )&=n_{0} \\ \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 30
ode:=diff(n(t),t) = k*n(t)-b*t; 
ic:=[n(0) = n__0]; 
dsolve([ode,op(ic)],n(t), singsol=all);
 
\[ n = \frac {{\mathrm e}^{k t} k^{2} n_{0} +b t k -{\mathrm e}^{k t} b +b}{k^{2}} \]
Mathematica. Time used: 0.04 (sec). Leaf size: 33
ode=D[n[t],t]==k*n[t]-b*t; 
ic={n[0]==n0}; 
DSolve[{ode,ic},n[t],t,IncludeSingularSolutions->True]
 
\begin{align*} n(t)&\to \frac {b k t-b e^{k t}+b+k^2 \text {n0} e^{k t}}{k^2} \end{align*}
Sympy. Time used: 0.097 (sec). Leaf size: 27
from sympy import * 
t = symbols("t") 
n0 = symbols("n0") 
k = symbols("k") 
b = symbols("b") 
n = Function("n") 
ode = Eq(b*t - k*n(t) + Derivative(n(t), t),0) 
ics = {n(0): n0} 
dsolve(ode,func=n(t),ics=ics)
 
\[ n{\left (t \right )} = \frac {b t}{k} + \frac {b}{k^{2}} + \frac {\left (- b + k^{2} n_{0}\right ) e^{k t}}{k^{2}} \]