A formulation for higher dimensional inverse problems for the wave equation