80.1.20 problem 16 (c)

Internal problem ID [21138]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 1. First order linear differential equations. Excercise 1.5 at page 13
Problem number : 16 (c)
Date solved : Thursday, October 02, 2025 at 07:09:47 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} x^{\prime }-2 x&=2 t \end{align*}

With initial conditions

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