We present quadratic dynamic invariants and evaluate the Berry phase for the time-dependent Schrodinger equation with the most general variable quadratic Hamiltonian.