The authors prove a necessary and sufficient condition for there to exist a constant C such that for each ,
where , , , a, r, p, q, and n are fixed real numbers satisfying a number of specified relationships. Special cases of this inequality have appeared in a number of papers, including a previous paper of the authors [Comm. Pure Appl. Math. 35, 771-831 (1982; Zbl 0509.35067)] and a paper of B. Muckenhoupt and R. Wheeden [Trans. Am. Math. Soc. 192, 261-274 (1974; Zbl 0289.26010)]. The proof is lengthy but elementary, and consists of verifying a large number of cases.