# Variance replication using options

I would like to understand the intuition behind the following question:

Why a certain weighted sum of prices of put and calls is equivalent to the implied variance of an underlying?

A variance swap is replicated with a static basket of calls and puts (I understand that this replicates the implied variances) which are delta-hedged (this replicates the realized variance), but what I find difficult is the intuition behind that.

Let $t_0, t_1, \ldots, t_n$ be observation dates, where $0=t_0 < \cdots < t_n = T$, and $\{S_t \mid t \geq 0\}$ be the equity price process without dividend payments. Then the realized variance is defined by \begin{align*} \frac{252}{n}\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}}. \end{align*} Note that, for sufficiently small $x$, \begin{align*} \ln (1+x) \approx x - \frac{1}{2}x^2. \end{align*} Moreover, \begin{align*} \ln^2 (1+x) &\approx x^2\\ &\approx 2x - 2 \ln(1+x). \end{align*} Then \begin{align*} \sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}} &\approx 2\sum_{i=1}^n \frac{S_{t_{i}}-S_{t_{i-1}}}{S_{t_{i-1}}}-2\ln\frac{S_T}{S_0}. \end{align*} Assuming that the short interest rate $r_t$ is deterministic, \begin{align*} E\bigg(\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}}\bigg) &\approx 2\sum_{i=1}^n E\Bigg(E\bigg(\frac{S_{t_{i}}-S_{t_{i-1}}}{S_{t_{i-1}}}\mid S_{t_{i-1}}\bigg)\Bigg)-2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\ &= 2\sum_{i=1}^n E\Bigg(\frac{S_{t_{i-1}}e^{\int_{t_{i-1}}^{t_i}r_s ds}-S_{t_{i-1}}}{S_{t_{i-1}}}\Bigg)-2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\ &= 2\sum_{i=1}^n \Big(e^{\int_{t_{i-1}}^{t_i}r_s ds} -1\Big)-2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\ &\approx 2\sum_{i=1}^n \int_{t_{i-1}}^{t_i}r_s ds - 2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\ &= 2\int_0^T r_s ds - 2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\ &= 2\ln \Big(S_0 e^{\int_0^T r_s ds} \Big) - 2 \ln S_0 - 2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\ &= -2E\bigg(\ln\frac{S_T}{E(S_T)} \bigg). \end{align*} Note that, for any smooth function $f$, $a>0$, and $x>0$, \begin{align*} f(x) = f(a) + f'(a)(x-a) + \int_a^{\infty}(x-k)^+ f''(k)dk + \int_0^a (k-x)^+f''(k)dk. \end{align*} See also How to hedge a derivative that pays the reciprocal of the stock price?.
Consider the function $f(x)=\ln x$ with $x=S_T$ and $a = E(S_T)$. We have that \begin{align*} \ln S_T = \ln E(S_T) + \frac{S_T - E(S_T)}{E(S_T)} - \int_{E(S_T)}^{\infty} \frac{(S_T-k)^+}{k^2} dk - \int_0^{E(S_T)} \frac{(k-S_T)^+}{k^2} dk. \end{align*} Therefore, \begin{align*} E\bigg(\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}}\bigg) &\approx -2E\bigg(\ln\frac{S_T}{E(S_T)} \bigg)\\ &=2E\bigg[\int_{E(S_T)}^{\infty} \frac{(S_T-k)^+}{k^2} dk + \int_0^{E(S_T)} \frac{(k-S_T)^+}{k^2} dk\bigg], \end{align*} which is a weighted sum of prices of put and calls.
For an elementary and intuitive explanation, we consider the Black Scholes setting with a geometric Brownian motion. That is, \begin{align*} S_T &= S_0 \exp\big((r-\frac{1}{2}\sigma^2)T+\sigma W_T \big)\\ &= E(S_T) \exp\big(-\frac{1}{2}\sigma^2T+\sigma W_T \big), \end{align*} where $\{W_t\mid t\geq 0\}$ is a standard Brownian motion. Then, we have the variance \begin{align*} \sigma^2 =\frac{2}{T}\Big(\sigma W_T -\ln \frac{S_T}{E(S_T)} \Big). \end{align*} That is, \begin{align*} \sigma^2 = -\frac{2}{T}E\Big(\ln \frac{S_T}{E(S_T)}\Big), \end{align*} which, as demonstrated above, can be approximated by a weighted sum of prices of put and calls.