Survival probability $S(t) = Pr(T > t) = exp(-\int_0^t h(u) du)$.
In R, you can use function integrate
:
h <- function(t) exp(-5 + 1.2*t^2 + 0.5*t)
and the survival probability
t <- 2
exp(-integrate(h, 0, t)$value)
(I am constantly struggling with SO not supporting latex...)