30.6.32 problem 33

Internal problem ID [7567]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 33
Date solved : Tuesday, September 30, 2025 at 04:53:13 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} t +x+3+x^{\prime }&=0 \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 15
ode:=t+x(t)+3+diff(x(t),t) = 0; 
ic:=[x(0) = 1]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = -t -2+3 \,{\mathrm e}^{-t} \]
Mathematica. Time used: 0.038 (sec). Leaf size: 17
ode=(t+x[t]+3)+D[x[t],t]== 0; 
ic={x[0]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -t+3 e^{-t}-2 \end{align*}
Sympy. Time used: 0.065 (sec). Leaf size: 10
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(t + x(t) + Derivative(x(t), t) + 3,0) 
ics = {x(0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = - t - 2 + 3 e^{- t} \]