65.1.10 problem 5.4 (v)

Internal problem ID [13634]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 5, Trivial differential equations. Exercises page 33
Problem number : 5.4 (v)
Date solved : Wednesday, March 05, 2025 at 10:05:42 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} x^{\prime } {\mathrm e}^{3 t}+3 x \,{\mathrm e}^{3 t}&={\mathrm e}^{-t} \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=3 \end{align*}

Maple. Time used: 0.013 (sec). Leaf size: 16
ode:=diff(x(t),t)*exp(3*t)+3*x(t)*exp(3*t) = exp(-t); 
ic:=x(0) = 3; 
dsolve([ode,ic],x(t), singsol=all);
 
\[ x \left (t \right ) = -\left ({\mathrm e}^{-t}-4\right ) {\mathrm e}^{-3 t} \]
Mathematica. Time used: 0.062 (sec). Leaf size: 18
ode=D[x[t]*Exp[3*t],t]==Exp[-t]; 
ic={x[0]==3}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to e^{-4 t} \left (4 e^t-1\right ) \]
Sympy. Time used: 0.184 (sec). Leaf size: 14
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(3*x(t)*exp(3*t) + exp(3*t)*Derivative(x(t), t) - exp(-t),0) 
ics = {x(0): 3} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (4 - e^{- t}\right ) e^{- 3 t} \]