  We consider autonomous holonomic dynamical systems defined by equations of
the form $\ddot{q}^{a}=-\Gamma_{bc}^{a}(q) \dot{q}^{b}\dot{q}^{c}$ $-Q^{a}(q)$,
where $\Gamma^{a}_{bc}(q)$ are the coefficients of a symmetric (possibly
non-metrical) connection and $-Q^{a}(q)$ are the generalized forces. We prove a
theorem which for these systems determines autonomous and time-dependent first
integrals (FIs) of any order in a systematic way, using the `symmetries' of the
geometry defined by the dynamical equations. We demonstrate the application of
the theorem to compute linear, quadratic, and cubic FIs of various Riemannian
and non-Riemannian dynamical systems.
