Core Rulebook > Magic Items > Weapons. Or here. You add the +X price to the price of a masterwork weapon, and that is how much it costs. Special materials (in Equipment) might modify the price though.
What Durngrun and Android said, plus you have to add the price bonus from any other enhancements to the formula, not separately. So a +5, flaming weapon is 72,000 (+misc), not 52,000 [+6, squared is 36, x 2000gp = 72,000]