We present a novel technique for determining the solution of optimal power flow, including dynamic security constraints, using forward sensitivities computed by using finite differences. Finite differencing provides an easy way of computing the sensitivities of the dynamic security constraints in optimal power flow. A dynamic security measure based on the frequency excursion of the generators is presented. Our formulation also yields the marginal cost associated with the generator's frequency excursion.