10.10.11 problem 11

Internal problem ID [1343]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Chapter 3, Second order linear equations, section 3.6, Variation of Parameters. page 190
Problem number : 11
Date solved : Tuesday, March 04, 2025 at 12:30:14 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-5 y^{\prime }+6 y&=g \left (t \right ) \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 46
ode:=diff(diff(y(t),t),t)-5*diff(y(t),t)+6*y(t) = g(t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = c_2 \,{\mathrm e}^{3 t}+{\mathrm e}^{2 t} c_1 +\left (\int g \left (t \right ) {\mathrm e}^{-3 t}d t \right ) {\mathrm e}^{3 t}-\left (\int g \left (t \right ) {\mathrm e}^{-2 t}d t \right ) {\mathrm e}^{2 t} \]
Mathematica. Time used: 0.06 (sec). Leaf size: 59
ode=D[y[t],{t,2}]-5*D[y[t],t]+6*y[t] == g[t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{2 t} \left (\int _1^t-e^{-2 K[1]} g(K[1])dK[1]+e^t \int _1^te^{-3 K[2]} g(K[2])dK[2]+c_2 e^t+c_1\right ) \]
Sympy. Time used: 0.852 (sec). Leaf size: 34
from sympy import * 
t = symbols("t") 
y = Function("y") 
g = Function("g") 
ode = Eq(-g(t) + 6*y(t) - 5*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (C_{1} + \left (C_{2} + \int g{\left (t \right )} e^{- 3 t}\, dt\right ) e^{t} - \int g{\left (t \right )} e^{- 2 t}\, dt\right ) e^{2 t} \]