# The action of Einstein Maxwell system for arbitrary dimensions

The question is as mentioned in the title. To write the action for the Einstein-Maxwell system in arbitrary dimension.

Is it possible just to add them (The Lagrangian for gravity and for electromagnetism) linearly to the Lagrangian in order to get the action?

I have not been able to find a lot of resources regarding this on the internet, if you have something relevant please comment.

Your total action will be $$S=S_{EH}+S_{EM} = \int d^nx \sqrt{-g}R+\int d^nx \sqrt{-g}(-\frac{1}{4}F^2)=\int d^nx\sqrt{-g}(R-\frac{1}{4}F^2),$$ where, just to be clear, $$F^2\equiv F_{\mu\nu}F^{\mu\nu}$$.