# Black Scholes PDE in forward log space

In BS world, we have the stock process in log space $$dS_t=(r-\frac{1}{2}\sigma^2)dt+\sigma dW$$. Let's say we want to price $$f(t,x)=\mathbb{E}_{t,x}[h(S(T)]$$. Using Feynman-kac, we get $$$$\frac{\partial f}{\partial t} + (r-\frac{1}{2}\sigma^2)\frac{\partial f}{\partial x}+\frac{1}{2} \sigma^2 \frac{\partial^2 f}{\partial x^2}-rV=0$$$$

On the other hand, if we consider the forward process (again in log space) $$F_t=S_t+r(T-t)$$, we have the forward process $$dF_t=-\frac{1}{2}\sigma^2 dt+\sigma dW$$ and the price becomes $$f(t,y)=\mathbb{E}_{t,y}[h(F(T)]$$. Using F-K again, we get $$$$\frac{\partial f}{\partial t} - \frac{1}{2}\sigma^2\frac{\partial f}{\partial y}+\frac{1}{2} \sigma^2 \frac{\partial^2 f}{\partial y^2}-rV=0$$$$

Somehow I fail to transform the first PDE to the second by change of variable directly from $$S_t$$ to $$F_t$$. Since $$y=x+r(T-t)$$, by chain rule, $$\frac{\partial f}{\partial x}=\frac{\partial f}{\partial x}\frac{\partial y}{\partial x}=\frac{\partial f}{\partial y}$$, i.e., the first order is the same and so as the second order. So I end up with $$$$\frac{\partial f}{\partial t} +(r-\frac{1}{2}\sigma^2)\frac{\partial f}{\partial y}+\frac{1}{2} \sigma^2 \frac{\partial^2 f}{\partial y^2}-rV=0$$$$ which is obviously wrong and I couldn't figure out why.

It's probably best to use different notation. So first of all $$f(t,x) := E_t (h(S_T))$$ and $$g(t, y) := E_t (h(F_T)).$$ Since $$S_T = F_T$$, by no arbitrage we must have $$g(t,y) = f(t,x) = f(t, y - r(T-t)).$$
This means that $$\frac{\partial g}{\partial t} = \frac{\partial f}{\partial t} + r \frac{\partial f}{\partial x}.$$ As you've already pointed out $$\frac{\partial g}{\partial y} = \frac{\partial f}{\partial x}.$$ Using this and the PDE satisfied by $$f$$ you will then obtain the following PDE for $$g$$: $$\frac{\partial g}{\partial t} -\frac12 \sigma^2 \left( \frac{\partial g}{\partial y} - \frac{\partial^2 g}{\partial y^2}\right) = rg$$