44.5.18 problem 18

Internal problem ID [7080]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.2 Separable equations. Exercises 2.2 at page 53
Problem number : 18
Date solved : Sunday, March 30, 2025 at 11:38:46 AM
CAS classification : [_separable]

\begin{align*} n^{\prime }+n&=n t \,{\mathrm e}^{t +2} \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 19
ode:=diff(n(t),t)+n(t) = n(t)*t*exp(t+2); 
dsolve(ode,n(t), singsol=all);
 
\[ n = c_1 \,{\mathrm e}^{-t +{\mathrm e}^{t +2} \left (t -1\right )} \]
Mathematica. Time used: 0.087 (sec). Leaf size: 28
ode=D[n[t],t]+n[t]==n[t]*t*Exp[t+2]; 
ic={}; 
DSolve[{ode,ic},n[t],t,IncludeSingularSolutions->True]
 
\begin{align*} n(t)\to c_1 e^{e^{t+2} (t-1)-t} \\ n(t)\to 0 \\ \end{align*}
Sympy. Time used: 0.429 (sec). Leaf size: 19
from sympy import * 
t = symbols("t") 
n = Function("n") 
ode = Eq(-t*n(t)*exp(t + 2) + n(t) + Derivative(n(t), t),0) 
ics = {} 
dsolve(ode,func=n(t),ics=ics)
 
\[ n{\left (t \right )} = C_{1} e^{t e^{t + 2} - t - e^{t + 2}} \]