14.11.14 problem 14

Internal problem ID [2607]
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 : 14
Date solved : Sunday, March 30, 2025 at 12:11:25 AM
CAS classification : [[_2nd_order, _missing_y]]

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

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