63.1.6 problem 6

Internal problem ID [12951]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.1 First order equations. Exercises page 10
Problem number : 6
Date solved : Wednesday, March 05, 2025 at 08:54:41 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} x^{\prime }+2 x&=t^{2}+4 t +7 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 20
ode:=diff(x(t),t)+2*x(t) = t^2+4*t+7; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {t^{2}}{2}+\frac {3 t}{2}+\frac {11}{4}+c_{1} {\mathrm e}^{-2 t} \]
Mathematica. Time used: 0.105 (sec). Leaf size: 38
ode=D[x[t],t]+2*x[t]==t^2+4*t+7; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to e^{-2 t} \left (\int _1^te^{2 K[1]} \left (K[1]^2+4 K[1]+7\right )dK[1]+c_1\right ) \]
Sympy. Time used: 0.139 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**2 - 4*t + 2*x(t) + Derivative(x(t), t) - 7,0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- 2 t} + \frac {t^{2}}{2} + \frac {3 t}{2} + \frac {11}{4} \]