10.1.17 problem 17

Internal problem ID [1114]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.1. Page 40
Problem number : 17
Date solved : Saturday, March 29, 2025 at 10:39:28 PM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

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

Maple. Time used: 0.027 (sec). Leaf size: 12
ode:=-2*y(t)+diff(y(t),t) = exp(2*t); 
ic:=y(0) = 2; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \left (t +2\right ) {\mathrm e}^{2 t} \]
Mathematica. Time used: 0.042 (sec). Leaf size: 14
ode=-2*y[t]+D[y[t],t] == Exp[2*t]; 
ic=y[0]==2; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{2 t} (t+2) \]
Sympy. Time used: 0.140 (sec). Leaf size: 10
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-2*y(t) - exp(2*t) + Derivative(y(t), t),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (t + 2\right ) e^{2 t} \]