38.6.22 problem 22

Internal problem ID [8452]
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.3 Linear equations. Exercises 2.3 at page 63
Problem number : 22
Date solved : Tuesday, September 30, 2025 at 05:37:16 PM
CAS classification : [_separable]

\begin{align*} p^{\prime }+2 t p&=p+4 t -2 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=diff(p(t),t)+2*t*p(t) = p(t)+4*t-2; 
dsolve(ode,p(t), singsol=all);
 
\[ p = 2+{\mathrm e}^{-t \left (t -1\right )} c_1 \]
Mathematica. Time used: 0.033 (sec). Leaf size: 24
ode=D[p[t],t]+2*t*p[t]==p[t]+4*t-2; 
ic={}; 
DSolve[{ode,ic},p[t],t,IncludeSingularSolutions->True]
 
\begin{align*} p(t)&\to 2+c_1 e^{t-t^2}\\ p(t)&\to 2 \end{align*}
Sympy. Time used: 0.163 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
p = Function("p") 
ode = Eq(2*t*p(t) - 4*t - p(t) + Derivative(p(t), t) + 2,0) 
ics = {} 
dsolve(ode,func=p(t),ics=ics)
 
\[ p{\left (t \right )} = C_{1} e^{t \left (1 - t\right )} + 2 \]