Solution (source code)

= Solution
{c}

Under the <risk-neutral measure>, write $Z\sim N(0,1)$, $a=\sigma\sqrt\tau$, and $m=\log(S/K)+(r-\sigma^2/2)\tau$. Then $\log(S_T/K)=m+aZ$ and $d_-=m/a$. By <risk-neutral pricing>, this <log-call option> has value $e^{-r\tau}\mathbb E[(m+aZ)^+]$.

Let $\phi$ and $\Phi$ denote the <standard normal density> and <standard normal distribution function>. The <Gaussian positive-part expectation> follows by integration:
$$
\mathbb E[(m+aZ)^+]
=\int_{-d_-}^{\infty}(m+az)\phi(z)\,dz
=m\Phi(d_-)+a\phi(d_-),
$$
because $\phi'(z)=-z\phi(z)$. Therefore
$$
\boxed{V(S,t)=e^{-r\tau}\sigma\sqrt\tau
\left[d_-\Phi(d_-)+\frac{e^{-d_-^2/2}}{\sqrt{2\pi}}\right],\qquad
d_-=\frac{\log(S/K)+(r-\sigma^2/2)\tau}{\sigma\sqrt\tau}.}
$$
For $\tau=0$ take the continuous terminal <limit> $(\log(S/K))^+$.