66.2.8 problem Problem 8

Internal problem ID [13836]
Book : Differential equations and the calculus of variations by L. ElSGOLTS. MIR PUBLISHERS, MOSCOW, Third printing 1977.
Section : Chapter 2, DIFFERENTIAL EQUATIONS OF THE SECOND ORDER AND HIGHER. Problems page 172
Problem number : Problem 8
Date solved : Monday, March 31, 2025 at 08:14:42 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 27
ode:=diff(diff(x(t),t),t)-4*diff(x(t),t)+4*x(t) = exp(t)+exp(2*t)+1; 
dsolve(ode,x(t), singsol=all);
 
\[ x = \frac {\left (4 t c_1 +2 t^{2}+4 c_2 \right ) {\mathrm e}^{2 t}}{4}+{\mathrm e}^{t}+\frac {1}{4} \]
Mathematica. Time used: 0.281 (sec). Leaf size: 32
ode=D[x[t],{t,2}]-4*D[x[t],t]+4*x[t]==Exp[t]+Exp[2*t]+1; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to e^{2 t} \left (\frac {t^2}{2}+c_2 t+c_1\right )+e^t+\frac {1}{4} \]
Sympy. Time used: 0.241 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(4*x(t) - exp(2*t) - exp(t) - 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)) - 1,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^{2 t} + e^{t} + \frac {1}{4} \]