14.10.3 problem 3

Internal problem ID [2585]
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 : 3
Date solved : Sunday, March 30, 2025 at 12:10:49 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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