68.5.52 problem 59

Internal problem ID [17303]
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 : 59
Date solved : Thursday, October 02, 2025 at 02:01:15 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y+y^{\prime }&=2 \cos \left (t \right )+t \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 17
ode:=diff(y(t),t)+y(t) = 2*cos(t)+t; 
dsolve(ode,y(t), singsol=all);
 
\[ y = \cos \left (t \right )+\sin \left (t \right )+t -1+{\mathrm e}^{-t} c_1 \]
Mathematica. Time used: 0.045 (sec). Leaf size: 34
ode=D[y[t],t]+y[t]==2*Cos[t]+t; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to e^{-t} \left (\int _1^te^{K[1]} (2 \cos (K[1])+K[1])dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 0.080 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t + y(t) - 2*cos(t) + Derivative(y(t), t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{1} e^{- t} + t + \sin {\left (t \right )} + \cos {\left (t \right )} - 1 \]