Regarding how to type A^1 (or any other math expression) in a section heading, ..., it depends.
For traditional publishers of pure mathematics, the answer is "enter it as ordinary math", or $A^1$. The American Mathematical Society's style guide says this (section 3.1):
Math is always permissible in section heads, but displays are not. Any math in any head appears in math mode; it is not fonted to match the section head.
Translated out of jargon, this means that the font of a math expression is not changed in a bold (or small caps) heading; it should appear exactly as it does in text.
The reason for this is that, rather often, mathematicians use both a lightface and a bold version of the same letter in the same document to mean two different things. (Sometimes, even more variations on a single letter are used!) To embolden a lightface letter (as used in text) could therefore cause confusion, especially among less experienced readers.
That said, the practice is sometimes different in disciplines other than pure math, e.g., physics. In such a case, \boldmath would serve to embolden the expression: \boldmath ... $A^1$.
A comment to the question states that this is the reason why \boldmath was created. Not so. Some fonts used for math are available only in lightface versions, and if a letter or other symbol in such a font is needed in bold form to make a necessary mathematical distinction, \boldmath (or better, \bm applied to only that character`) is a way to make the bold form available.
\section{\boldmath How to calculate $A^{-1}$}? – Feb 04 '20 at 08:00\section{How to calculate $A^{-1}$}(the symbol for the matrix should be the same as in the text). – egreg Feb 04 '20 at 08:02\bmadvice, if you prefer to abuse notation. – egreg Feb 04 '20 at 08:25\boldmathexists for a reason. Namely to allow one to have a consistent font weights in section headings and so on. Given that there is an agreement that the font size gets adjusted, I really do not understand the apparent disagreement on the font weight. (I just pulled out one of my favorite book to double-check what I already knew:$p$-adicreally gets typset as\boldmath $p$-adicin the section title. It is a respected publisher, and the only books where I can see deviations are old, perhaps older than\boldmath.) – Feb 04 '20 at 23:19