65.3.6 problem 8.2

Internal problem ID [13645]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 8, Separable equations. Exercises page 72
Problem number : 8.2
Date solved : Wednesday, March 05, 2025 at 10:06:19 PM
CAS classification : [_quadrature]

\begin{align*} x^{\prime }+p x&=q \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 18
ode:=diff(x(t),t)+p*x(t) = q; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {{\mathrm e}^{-p t} c_{1} p +q}{p} \]
Mathematica. Time used: 0.039 (sec). Leaf size: 29
ode=D[x[t],t]+p*x[t]==q; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {q}{p}+c_1 e^{-p t} \\ x(t)\to \frac {q}{p} \\ \end{align*}
Sympy. Time used: 0.120 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
p = symbols("p") 
q = symbols("q") 
x = Function("x") 
ode = Eq(p*x(t) - q + Derivative(x(t), t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- p t} + \frac {q}{p} \]