The Black Scholes Formula for a European Call
The mean rate of grownth of all assets under the risk-neutral measure $\mathbb{Q}$ is risk-free rate $r$.
The stock price process has the $\mathbb{Q}$-dynamics:
$$dS_t = r S_t dt + \sigma S_t dW^{\mathbb{Q}}(t) \tag{1}$$
The solution to this SDE is:
$$S(t) = S(0)\exp \left[ \left(r - \frac{\sigma^2}{2}\right)t + \sigma W^{\mathbb{Q}}(t)\right]\tag{2}$$
Consider a call option with maturity time $T$. Then, the stock price at $T$ is:
$$S(T) = S(0)\exp \left[ \left(r - \frac{\sigma^2}{2}\right)T + \sigma W^{\mathbb{Q}}(T)\right]\tag{3}$$
Denoting $\tau = T - t$, we have:
$$S(T) = S(t)\exp \left[ \left(r - \frac{\sigma^2}{2}\right)\tau + \sigma (W^{\mathbb{Q}}(T)-W^{\mathbb{Q}}(t))\right]\tag{4}$$
Since, $W^{\mathbb{Q}}(T)-W^{\mathbb{Q}}(t)$ is a gaussian random variable with mean $0$ and variance $\tau = T-t$, we can write $-(W^{\mathbb{Q}}(T)-W^{\mathbb{Q}}(t)) = \sqrt{\tau}Z$, where $Z$ is a standard normal random variable. Thus,
$$S(T) = S(t)\exp \left[ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}Z\right]\tag{5}$$
By the risk-neutral pricing formula, the time-$t$ price of the European call option is:
$$
\begin{align*}
V(t) &= \mathbb{E}^{\mathbb{Q}}\left[e^{-r(T-t)}\max(S(T) - K,0)|\mathcal{F}_t\right] \\
&= e^{-r(T-t)}\mathbb{E}^{\mathbb{Q}}\left[\left(S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}Z\right\} - K\right)\cdot 1_{S(T)>K}|\mathcal{F}_t\right]\\
&= e^{-r(T-t)}\mathbb{E}^{\mathbb{Q}}\left[\left(S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}Z\right\} - K\right)\cdot 1_{S_t e^{(r-\sigma^2/2) - \sigma\tau Z}>K}\right]
\end{align*}
$$
In the last-but-one step, everything is $\mathcal{F}_t$-measurable.
The domain of integration is all $z$ satisfying:
$$
\begin{align*}
S(t)\exp \left[ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}Z\right] &> K\\
\log \frac{S(t)}{K} + \left(r - \frac{\sigma^2}{2}\right)\tau &> \sigma \sqrt{\tau}Z
\end{align*}
$$
Define $d_{-} = \frac{\log \frac{S(t)}{K} +(r-\sigma^2/2)\tau}{\sigma\sqrt{\tau}}$.
Then, the region $D$ is:
$$Z < d_{-}$$
So, we can expand the expectation in (6) as:
$$
\begin{align*}
V(t) &= \int_{-\infty}^{d_{-}} e^{-r\tau}\left(S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}z\right\} - K\right) d\mathbb{Q} \\
&=\int_{-\infty}^{d_{-}} e^{-r\tau}\left(S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}z\right\} - K\right) f_Z^{\mathbb{Q}}(z) dz \\
&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_{-}}e^{-r\tau} \left(S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}z\right\} - K\right) e^{-\frac{z^2}{2}} dz \\
&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_{-}} e^{-r\tau}S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}z\right\}e^{-\frac{z^2}{2}} dz \\&- Ke^{-r\tau}\cdot \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_{-}} e^{-\frac{z^2}{2}} dz \\
&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_{-}} e^{-r\tau}S(t)\exp \left\{ \left(r - \frac{\sigma^2}{2}\right)\tau - \sigma \sqrt{\tau}z\right\}e^{-\frac{z^2}{2}} dz - Ke^{-r\tau}\Phi(d_{-})\tag{7}
\end{align*}
$$
We have:
$$
\begin{align*}
&\exp \left[-\frac{\sigma^2}{2}\tau - \sigma\sqrt{\tau} z - \frac{z^2}{2}\right]\\\\
=&\exp\left[-\frac{\sigma^2 \tau + 2\sigma \sqrt{\tau}z + z^2}{2}\right]\\\\
=&\exp\left[-\frac{(z+\sigma\sqrt{\tau})^2}{2}\right] \tag{8}
\end{align*}
$$
Substituting (8) into (7), we get:
$$
\begin{align*}
V(t) &=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_{-}} S(t)\exp\left[-\frac{(z+\sigma\sqrt{\tau})^2}{2}\right] dz - Ke^{-r\tau}\Phi(d_{-}) \tag{9}
\end{align*}
$$
Put $u = z + \sigma \sqrt{\tau}$. Then, $dz = du$. The upper limit of integration is $d_{+} = d_{-} + \sigma \sqrt{\tau}$, which is:
$$
\begin{align*}
d_{+} &=\frac{\log \frac{S(t)}{K} + (r-\sigma^2/2)\tau}{\sigma \sqrt{\tau}} + \sigma \sqrt{\tau}\\\\
&= \frac{\log \frac{S(t)}{K} + (r+\sigma^2/2)\tau}{\sigma \sqrt{\tau}}
\end{align*}
$$
So, the equation (9) can be written as:
$$
\begin{align*}
V(t) &=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_{+}} S(t)e^{-\frac{u^2}{2}} du - Ke^{-r\tau}\Phi(d_{-}) \\\\
&= S(t)\Phi(d_{+}) - Ke^{-r\tau} \Phi(d_{-})
\end{align*}
$$
Appendix
Lemma. The discounted stock-price process $(D(t)S(t),t\geq 0)$ is a $\mathbb{Q}$-martingale.
Suppose we have a risk-free money-market account with the dynamics:
$$dM(t) = rM(t)dt$$
and the dynamics of the stock-price process is:
$$dS(t) = \mu S(t) dt + \sigma S(t) dW^\mathbb{P}(t)$$
Thus, the discounting process is:
$$dD(t) = -rD(t)dt$$
where the instantaneous interest rate $r$ is a constant.
By Ito’s product rule:
$$
\begin{align*}
d(D(t)S(t)) &= dD(t) S(t) + D(t)dS(t)\\\\
&= -rD(t)S(t)dt + D(t)(\mu S(t) dt + \sigma S(t)dW^\mathbb{P}(t))\\\\
&= D(t)S(t)((\mu - r)dt + \sigma dW^\mathbb{P}(t))\\\\
\end{align*}
$$
We are interested to write:
$$
\begin{align*}
d(D(t)S(t)) &= D(t)S(t)\sigma dW^\mathbb{Q}(t)
\end{align*}
$$
Comparing the right hand sides, we have:
$$
\begin{align*}
\sigma dW^\mathbb{Q}(t) &= (\mu - r)dt + \sigma dW^\mathbb{P}(t)
\end{align*}
$$
Let’s define:
$$dW^\mathbb{Q}(t) = \theta dt + dW^\mathbb{P}(t)$$
where $\theta = (\mu - r)/\sigma$ and the Radon-Nikodym derivative $Z$ as:
$$Z = \exp\left[-\int_0^T \theta dW^\mathbb{P}(u) - \frac{1}{2}\int_0^T \theta^2 du \right]$$
By the Girsanov theorem, $W^\mathbb{Q}(t)$ is a $\mathbb{Q}$-standard brownian motion. Hence, we can write:
$$
\begin{align*}
d(D(t)S(t)) &= D(t)S(t)\sigma dW^\mathbb{Q}(t)
\end{align*}
$$
Since the Ito integral is a martingale, $D(t)S(t)$ is a $\mathbb{Q}$-martingale. This closes the proof.
Claim. The $\mathbb{Q}$-dynamics of $S_t$ satisfy :
$$dS(t) = rS(t) dt + \sigma S(t) dW^{\mathbb{Q}}(t)$$
Proof.
We have:
$$
\begin{align*}dS(t) &= d(S(t)D(t)M(t))\\\\
&= d(S(t)D(t))M(t) + S(t)D(t)dM(t)\\\\
&= D(t)M(t) S(t)\sigma dW^\mathbb{Q}(t) + S(t)D(t)r M(t)dt\\\\
&= S(t)(rdt + \sigma dW^\mathbb{Q}(t))
\end{align*}
$$
We can easily solve this linear SDE; its solution is:
$$S(t) = S(0)\exp\left[\left(\mu - \frac{\sigma^2}{2}\right)dt + \sigma W^\mathbb{Q}(t)\right]$$