In this work, we derive an analytical procedure that allows us to write the multidimensional washboard ratchet potential (MDWBP) Uf for a two-dimensional Josephson junction array. The array has an applied perpendicular magnetic field. The magnetic field is given in units of the quantum flux per plaquette or frustration of the form , where Φ0 is the flux quantum. The derivation is done under the assumption that the checkerboard pattern ground state or unit cell of a two-dimensional Josephson junction array is preserved under current biasing. The resistively and capacitively shunted Josephson junction model with a white noise term describes the dynamics for each junction in the array. The multidimensional potential is the unique expression of the collective effects that emerge from the array in contrast to the single junction. The first step in the procedure is to write the equation for the phases for the unit cell. In doing this, one takes into account the constraints imposed for the gauge invariant phases due to frustration. Second, and the key idea of the procedure, is to perform a variable transformation from the original systems of stochastic equations to a system of variables where the condition for the equality of mixed second partial happens. This is achieved via Poincaré's theorem for differential forms. In this way, we find to a nonlinear matrix equation (equation () in the text), that permits us to find the new coordinate variables xf where the potential exists. The transformation matrix also permits the correct transformation of the original white noise terms of each junction to the intensities in the xf variables. The commensurate symmetries of the ground state pinned vortex lattice leads to discrete symmetries to the part of the washboard potential that does not contain a tilt due to the external bias current (equation () in the text). In this work we apply the procedure for the important cases . For , we show that previously efforts for finding the potential are restricted, leading to a reduced dimension of the potential. The correct potential is given in equation (). We examine this issue in detail. New physics emerge when currents are applied in the x and y directions, in particular, we confirm analytically previous numerical work for , concerning the border of stationary states, a landmark of the potential. For , we give a generalization of previous work, in which we include both the currents in the x and y directions as well the noise terms. We find the MDWBP realizes tilted ratchets analogous to a combustion motor.