The battery is in the trunk, to the left.
BMW F10 chassis
The battery is under the hood. Open the hood and remove the plastic cover on the left side.
BMW G30 chassis
To access the battery, go to the trunk and lift the floor panel and remove the plastic cover underneath the right panel of the trunk. If the battery is covered by a plastic panel, unclip the panel in the corners to remove it and access the battery, which is fixed in place by a clamp-type bracket. To remove the bracket holding the battery, squeeze the two latches on the handle in and the battery will pop up. Pull up the battery up and out.