75.33.15 problem 844

Internal problem ID [17218]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 3. Section 24.2. Solving the Cauchy problem for linear differential equation with constant coefficients. Exercises page 249
Problem number : 844
Date solved : Thursday, March 13, 2025 at 09:18:59 AM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} x^{\prime \prime }+4 x^{\prime }+4 x&=4 \end{align*}

Using Laplace method With initial conditions

\begin{align*} x \left (0\right )&=1\\ x^{\prime }\left (0\right )&=-4 \end{align*}

Maple. Time used: 8.582 (sec). Leaf size: 13
ode:=diff(diff(x(t),t),t)+4*diff(x(t),t)+4*x(t) = 4; 
ic:=x(0) = 1, D(x)(0) = -4; 
dsolve([ode,ic],x(t),method='laplace');
 
\[ x \left (t \right ) = 1-4 t \,{\mathrm e}^{-2 t} \]
Mathematica. Time used: 0.017 (sec). Leaf size: 15
ode=D[x[t],{t,2}]+4*D[x[t],t]+4*x[t]==4; 
ic={x[0]==1,Derivative[1][x][0 ]==-4}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to 1-4 e^{-2 t} t \]
Sympy. Time used: 0.177 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(4*x(t) + 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)) - 4,0) 
ics = {x(0): 1, Subs(Derivative(x(t), t), t, 0): -4} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = - 4 t e^{- 2 t} + 1 \]