Synthesis of 1,2- and 1,3-dicarboxylic acids via Pd(II)-catalyzed carboxylation of aryl and vinyl C-H bonds.