Conjugate points in the calculus of variations and optimal control theory via the quadratic form theory