74.5.43 problem 50

Internal problem ID [15936]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.3, page 49
Problem number : 50
Date solved : Monday, March 31, 2025 at 02:13:53 PM
CAS classification : [[_linear, `class A`]]

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

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