14.10.4 problem 4

Internal problem ID [2586]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.4. The method of variation of parameters. Excercises page 156
Problem number : 4
Date solved : Sunday, March 30, 2025 at 12:10:51 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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