2.3.3.6 ✓ Sympy. Time used: 0.346 (sec). Leaf size: 53
from sympy import *
t = symbols("t")
x = Function("x")
ode = Eq(4*x(t) - exp(t)*cos(2*t) + 2*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0)
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 1}
dsolve(ode,func=x(t),ics=ics)
\begin{gather*} \begin {aligned} x{\left (t \right )} = \left (\frac {17 \sqrt {3} \sin {\left (\sqrt {3} t \right )}}{73} - \frac {3 \cos {\left (\sqrt {3} t \right )}}{73}\right ) e^{- t} + \frac {\left (8 \sin {\left (2 t \right )} + 3 \cos {\left (2 t \right )}\right ) e^{t}}{73} \end {aligned} \end{gather*}
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
Sympy version 1.14.0
classify_ode(ode,func=x(t))
('factorable', 'nth_linear_constant_coeff_undetermined_coefficients', 'nth_linear_constant_coeff_variation_of_parameters', 'nth_linear_constant_coeff_variation_of_parameters_Integral')