65.7.4 problem 14.1 (iv)

Internal problem ID [13689]
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 (iv)
Date solved : Wednesday, March 05, 2025 at 10:12:08 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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