Integral inequalities for algebraic and trigonometric polynomials