I have the bosonic string action:

\(S= - {1 \over 4 \pi \alpha'} \int_\Sigma d^2\sigma \sqrt{-g} g^{ab} \partial_a X^\mu \partial_b X^\nu G_{\mu\nu}(X)\, +\epsilon^{ab} B_{\mu\nu}(X) \partial_a X^\mu \partial_b X^\nu\)

where \(G_{\mu\nu}\)is the metric for the background spacetime, \(g_{ab}\)is the worldsheet metric, \(B_{\mu\nu}\)is the Kalb-Ramond 2-form field and \(\epsilon^{ab}\)is the totally antisymmetric tensor density.

I'm supposed to get the equations of motion:

\[\partial_a \partial^a X^\mu + \Gamma^\mu_{\nu\rho}\partial_a X^\nu \partial^a X^\rho - \frac{1}{2} H^\mu_{\nu\rho} \partial_a X^\nu \partial_b X^\rho \epsilon^{ab}= 0\]

where \(\Gamma^\mu_{\nu\rho}\)are the connection components for the background spacetime and \(H^{\mu}_{\mu\rho} = G^{\mu\xi}H_{\xi\nu\rho}\)are the components of the Kalb-Ramond field strength \(H=dB\). When I vary the second term of the action I get a term of the form \(\nabla_a B_{\mu\nu} \partial_b X^\nu \epsilon^{ab} = \nabla_\rho B_{\mu\nu} \partial_a X^\rho \partial_bX^\nu \epsilon^{ab}\), but I don't know how to get the other terms of \(H_{\mu\nu\rho} = \frac{1}{2} \nabla_{[\mu} B_{\nu\rho]}\).

What I do instead is assume the worldsheet is the boundary of some 3-dimensional region. Then the second term of the action turns into an integral of \(H\) over this region and the variation gives the desired equations of motions.

This seems a bit hacky, as I'm not sure I can assume the worldsheed is a boundary even for a closed string, and obviously not for the open string. I'd also like to analyze the two terms of the action in parallel. Is there a way to get the equations of motion in this form by direct variation of the action?