# Confused by Solution to the Expected Profit when Hedging an option using Implied Volatility (from Wilmott 2006)

Paul Wilmott on Quantitative Finance 2nd Ed (section 12.5.1) gives a solution to the initial expected profit when hedging using delta based on implied volatility as

$$\frac{1}{2}(σ^2 - σ̃^2) \,\int_{t_0}^{T}e^{-r(s-t_0)}S^2\Gamma\,ds$$

from which he then derives the single integral $$\frac{Ee^{-r(T-t_0)}(σ^2 - σ̃^2)}{2\sqrt{2\pi}} \, \int_{t_0}^{T} \frac{1}{\sqrt{σ^2(s-t_0) + σ̃^2(T-s)}} \\ \times \exp\left( - \frac{(log(S/E) + (\mu - 0.5σ^2)(s-t_0) + (r - D - 0.5σ̃^2)(T-s))^2}{2(σ^2(s-t_0) + σ̃^2(T-s))} \right)\\$$

However, and very confusingly, in order to get similar results to those shown by him when comparing expected profit versus various growth rates (as per figures 12.4, 12.5, 12.6) I have to set the initial term to

$$\frac{Ee^{-r(T-t_0)}(σ^2 - σ̃^2)}{\frac{2}{\sqrt{2\pi}}}$$ instead of $$\frac{Ee^{-r(T-t_0)}(σ^2 - σ̃^2)}{2\sqrt{2\pi}}$$ as set out in the text.

My implementation uses numerical integration from the Python SciPy package.
When implementing it as shown, the magnitude of the expected profit is clearly excessive but with the change in denominator it's nearly spot on.

In the VBA code accompanying Paul Wilmott Introduces Quantitative Finance 2nd Ed he has an approximate solution which also uses $${\frac{2}{\sqrt{2\pi}}}$$ instead of $${2\sqrt{2\pi}}$$