76.2.1 problem 1

Internal problem ID [17258]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.2 (Linear equations: Method of integrating factors). Problems at page 54
Problem number : 1
Date solved : Thursday, March 13, 2025 at 09:22:11 AM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.002 (sec). Leaf size: 21
ode:=diff(y(t),t)+4*y(t) = t+exp(-2*t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {t}{4}-\frac {1}{16}+\frac {{\mathrm e}^{-2 t}}{2}+{\mathrm e}^{-4 t} c_{1} \]
Mathematica. Time used: 0.166 (sec). Leaf size: 37
ode=D[y[t],t]+4*y[t]==t+Exp[-2*t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{-4 t} \left (\int _1^t\left (e^{4 K[1]} K[1]+e^{2 K[1]}\right )dK[1]+c_1\right ) \]
Sympy. Time used: 0.171 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t + 4*y(t) + Derivative(y(t), t) - exp(-2*t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{1} e^{- 4 t} + \frac {t}{4} - \frac {1}{16} + \frac {e^{- 2 t}}{2} \]