Quadratic Functions and Applications