14.11.11 problem 11

Internal problem ID [2604]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.5. Method of judicious guessing. Excercises page 164
Problem number : 11
Date solved : Sunday, March 30, 2025 at 12:11:20 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y^{\prime }-6 y&=\sin \left (t \right )+t \,{\mathrm e}^{2 t} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 38
ode:=diff(diff(y(t),t),t)+diff(y(t),t)-6*y(t) = sin(t)+t*exp(2*t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {\left (25 t^{2}+250 c_2 -10 t +2\right ) {\mathrm e}^{2 t}}{250}+{\mathrm e}^{-3 t} c_1 -\frac {\cos \left (t \right )}{50}-\frac {7 \sin \left (t \right )}{50} \]
Mathematica. Time used: 0.164 (sec). Leaf size: 51
ode=D[y[t],{t,2}]+D[y[t],t]-6*y[t]==Sin[t]+t*Exp[2*t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {1}{250} \left (e^{2 t} \left (25 t^2-10 t+2\right )-35 \sin (t)-5 \cos (t)\right )+c_1 e^{-3 t}+c_2 e^{2 t} \]
Sympy. Time used: 0.241 (sec). Leaf size: 36
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t*exp(2*t) - 6*y(t) - sin(t) + Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{2} e^{- 3 t} + \left (C_{1} + \frac {t^{2}}{10} - \frac {t}{25}\right ) e^{2 t} - \frac {7 \sin {\left (t \right )}}{50} - \frac {\cos {\left (t \right )}}{50} \]