# Changing parameterization in Dupire's Formula

In chapter 2 of Bergomi's book on stochastic volatility, we have dupire's formula given as $$\sigma(S, t)^2 = \left|\frac{\frac{\partial C}{\partial T} + (r-q)K\frac{\partial C}{\partial K} + qC}{\frac{1}{2}K^2\frac{\partial^2 C}{\partial K^2}}\right|_{K=S, T=t}$$ where $$C$$ is the price of a call option under the local volatility model $$dS_t/S_t = (r-q)dt + \sigma(t,S_t)dW_t$$.

With the following change of variables to log moneyness, $$y = \log \frac{K}{F_t} = \log \frac{K}{S} - (r-q)t$$ and $$f(t,y) = (t - t_0)\widehat{\sigma}_{K,T}^2$$ and using the Black Scholes formula Bergomi states that the above formula becomes $$\sigma(S, t)^2 = \left|\frac{\frac{\partial f}{\partial t}}{\left(\frac{y}{2f}\frac{df}{dy} - 1\right)^2 + \frac{1}{2}\frac{d^2f}{dy^2} - \frac{1}{4}\left(\frac{1}{4} + \frac{1}{f}\right)\left(\frac{df}{dy}\right)^2}\right|_{y = \log \frac{S}{F_t}}$$

I would like help deriving this change in second formula given the first one. I am having trouble changing variables as the expressions I am getting are quite messy.

I started with the fact that we have $$C(K,T) = C_{BS}(K, T, \widehat{\sigma}_{K,T})$$ We have to change from $$C$$ to $$C_{BS}$$ and also from $$(K,T)$$ to $$(y,T)$$. I started with this but it got a bit too hairy and I'd like a little help with it.

EDIT: I'll add a bit of the direction I was taking. Let $$C_{BS}(y,t) = Se^{qt}\left(N(d+) - e^{y}N(d-)\right)$$ where $$d_{\pm} = \frac{-y}{\sqrt{f(t,y)}} \pm \frac{\sqrt{f(t,y)}}{2}$$ This is exactly the black scholes formula $$C_{BS}(K,T, \widehat{\sigma}_{K,T})$$ with variables changed to $$y, t$$. So we have $$C(K,T) = C_{BS}(y(K,T),T)$$

To get the first formula we need to compute things like $$\frac{\partial C}{\partial K}$$. We have $$\frac{\partial C}{\partial K} = \frac{\partial C_{BS}}{\partial y} \frac{\partial y}{\partial K}$$ and $$\frac{\partial C_{BS}}{\partial y} = Se^{qt}\left[N'(d+)\left(\frac{\sqrt{f} + \frac{y}{2\sqrt{f}}\frac{df}{dy}}{f} + \frac{1}{2\sqrt{f}}\frac{df}{dt}\right) - e^yN(d-)-e^yN'(d-)\left(\frac{\sqrt{f} + \frac{y}{2\sqrt{f}}\frac{df}{dy}}{f} - \frac{1}{2\sqrt{f}}\frac{df}{dt}\right)\right]$$

As you can see, it is getting really hairy already with just one term. I don't know if I am doing something wrong or missing some obvious simplifications, but I would like some help with this.