2.3.1.6 ✓ Sympy. Time used: 0.126 (sec). Leaf size: 20
from sympy import *
t = symbols("t")
x = Function("x")
ode = Eq(-t**2 - x(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 )} = - t^{2} + \frac {3 e^{t}}{2} - 2 + \frac {e^{- t}}{2} \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))
('nth_linear_constant_coeff_undetermined_coefficients', 'nth_linear_constant_coeff_variation_of_parameters', 'nth_linear_constant_coeff_variation_of_parameters_Integral')