The aim of this paper is to generalize the uniform method of obtaining integral inequalities in order to derive inequalities involving a function h, its first and second derivatives with weights. Such inequalities have been considered before by others, but other methods were applied. Our method makes it possible to obtain, in a natural way, the equality conditions important in differential equations. Moreover it allows us to avoid some assumptions on weights that have to be given in other methods. Then the inequality will be examined in order to simplify the boundary conditions for h. These considerations will be followed by examples with Chebyshev weight functions and constant weights with the classical Hardy, Littlewood, Polya inequality as a special case.