Proof

The definition of expected value for a continuous variable in this case gives an integral to evaluate since X is continuous. In that integral, it is useful to use a standard change of variables as in basic integral calculus to convert the integral to something easier to evaluate. In this case, you will want to convert the X variable to the standard units variable Z so that
\begin{equation*} z = \frac{x-\mu}{\sigma} \end{equation*}
or by solving for x
\begin{equation*} x = \mu + z \sigma. \end{equation*}
So, it follows that
\begin{align*} E[X] &= \int_{-\infty}^{\infty} x \cdot \frac{1}{\sigma \sqrt{2 \pi}} e^{ - \left ( \frac{x-\mu}{\sigma} \right ) ^2 / 2} dx \\ &= \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} (\mu + z\sigma) \cdot e^{ -z^2 / 2} dz\\ &= \mu \cdot \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} e^{ -z^2 / 2} dz + \sigma \cdot \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} z \cdot e^{ -z^2 / 2} dz\\ &= \mu \cdot 1 + \sigma \cdot 0\\ & = \mu \end{align*}
and therefore the use of \(\mu\) as the parameter in the normal distribution probability function is warranted.
in-context