72.6.7 problem 7

Internal problem ID [14653]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 1. First-Order Differential Equations. Exercises section 1.8 page 121
Problem number : 7
Date solved : Thursday, March 13, 2025 at 04:12:44 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }+2 y&={\mathrm e}^{\frac {t}{3}} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=1 \end{align*}

Maple. Time used: 0.015 (sec). Leaf size: 18
ode:=diff(y(t),t)+2*y(t) = exp(1/3*t); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \frac {\left (3 \,{\mathrm e}^{\frac {7 t}{3}}+4\right ) {\mathrm e}^{-2 t}}{7} \]
Mathematica. Time used: 0.053 (sec). Leaf size: 25
ode=D[y[t],t]+2*y[t]==Exp[t/3]; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {1}{7} e^{-2 t} \left (3 e^{7 t/3}+4\right ) \]
Sympy. Time used: 0.148 (sec). Leaf size: 19
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(2*y(t) - exp(t/3) + Derivative(y(t), t),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \frac {3 e^{\frac {t}{3}}}{7} + \frac {4 e^{- 2 t}}{7} \]