65.7.5 problem 14.1 (v)

Internal problem ID [13690]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 14, Inhomogeneous second order linear equations. Exercises page 140
Problem number : 14.1 (v)
Date solved : Wednesday, March 05, 2025 at 10:12:10 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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