In appendix A of Valuing Energy Options in a One Factor Model Fitted to Forward Prices by Les Clewlow and Chris Strickland they develop a stochastic differential equation of spot prices exploiting the relationship between Forwards and Spot prices i.e $S(t) = F(t,t)$. In simple terms, this means that the price of a future contract that delivers a good at time t for a future time t ($F(t,t)$) must be equal to the price of the good at time t ($S(t)$)
They define the following stochastic differential equation for the futures contract: $$ \frac{dF(t,T)}{F(t,T)} = \sigma(t,T)dW(t) $$
With a bit of ito calculus it is not very hard to obtain the solution for F(t,T) as $$ F(t,T) = F(0,T)exp\left(-\frac{1}{2}\int_{0}^{t} \sigma(u,T)^2 du + \int_{0}^{t} \sigma(u,T)dW(u)\right) $$
I we now exploit the relationship $S(t) = F(t,t)$ we can obtain the following equation:
$$ S(t) = F(0,t)exp\left(-\frac{1}{2}\int_{0}^{t} \sigma(u,t)^2 du + \int_{0}^{t} \sigma(u,t)dW(u)\right) $$
they then go ahead and state that by differentiation you can obtain the following expression for $S(t)$
$$ \frac{dS(t)}{S(t)} = \left[\frac{\partial lnF(0,t)}{\partial t} - \int_{0}^{t} \sigma(u,t) \frac{\partial \sigma(u,t)}{\partial t} du + \int_{0}^{t} \frac{\partial \sigma(u,t)}{\partial t}dW(u)\right]dt + \sigma(t,t)dW(t) $$
I am really struggling to do the derivation of this last equation. Can someone help me with the intuition behind it, please?
It is a mere application of Itô's lemma, but I must admit that the notation may turn out to be confusing because of two reasons. The first one is the presence of two different times, namely the time $t$ measuring the evolution of the stochastic process and the term $T$, which appear to coincide after some step, while the considered bivariate functions still treat them separately. The second reason is, I guess, the ambiguous notation $\int_0^t \ldots \mathrm{d}W_u$, which means $\int_{W_0}^{W_t} \ldots \mathrm{d}W_u$ actually.
Let's rewrite the quantity $S(t)$ by taking those ambiguities into account. Firstly, let's recall that $F(t,T)$ is a stochastic process, where $t$ is the real "passing" time and $T$ is just a parameter. Let's denote the dependence of processes on the time $t$ by a subscript, in the same manner as $W_t$, hence $F_t(T)$. In the same spirit, one has $S_t = F_t(t)$, where the second $t$ is still treated as a parameter, which appears to be equal to $t$ "by coincidence". Thus, we understand that $F_0(t)$ is only an initial condition with respect to the process, even if it is dependent on $t$ as a parameter; in consenquence, $F_0(t)$ will be later differentiated with respect to $t$ as a mere function and not as a stochastic process; in other words, we will get its differential with the help of a partial derivative instead of Itô's lemma, even it is a random variable.
Moreover, $S_t$ is also a function of a Brownian motion, so that $S_t = f(W_t,t)$, where $$ f(x,t) = F_0(t)\exp\left(-\frac{1}{2}\int_0^t \sigma_u(t)^2 \mathrm{d}u + \int_0^x \sigma_u(t) \mathrm{d}W_u\right). $$ Then, Itô's lemma is applied as usual, i.e. $\mathrm{d}S_t = \left(\partial_tf(W_t,t) + \partial_xf(W_t,t) + \frac{1}{2}\partial_x^2f(W_t,t)\right)\mathrm{d}t + \partial_xf(W_t,t)\mathrm{d}W_t$. Since the variables appear inside the integrals too, we must use Leibniz integral rule, hence : $$ \begin{array}{rcl} \partial_tf(W_t,t) &=& \displaystyle F_0(t)\exp\left(-\frac{1}{2}\int_0^t \sigma_u(t)^2 \mathrm{d}u + \int_0^{W_t} \sigma_u(t) \mathrm{d}W_u\right) \cdot \left(\frac{\partial_tF_0(t)}{F_0(t)} - \frac{1}{2}\sigma_t(t)^2 - \int_0^t \sigma_u(t)\partial_t\sigma_u(t) \mathrm{d}u + \int_0^{W_t} \partial_t\sigma_u(t) \mathrm{d}W_u\right) \\ &=& \displaystyle S_t\left(\partial_t\ln F_0(t) - \frac{1}{2}\sigma_t(t)^2 - \int_0^t \sigma_u(t)\partial_t\sigma_u(t) \mathrm{d}u + \int_0^{W_t} \partial_t\sigma_u(t) \mathrm{d}W_u\right) \end{array} $$ where the parentheses on the right contains the derivative of the argument of the exponential, while $$ \partial_xf(W_t,t) = F_0(t)\exp\left(-\frac{1}{2}\int_0^t \sigma_u(t)^2 \mathrm{d}u + \int_0^{W_t} \sigma_u(t) \mathrm{d}W_u\right) \cdot \sigma_t(t) = S_t\sigma_t(t), $$ and $$\partial_x^2f(W_t,t) = S_t\sigma_t(t)^2$$ in consequence. After collecting all the terms, we get : $$ \frac{\mathrm{d}S_t}{S_t} = \left(\partial_t\ln F_0(t) - \int_0^t \sigma_u(t)\partial_t\sigma_u(t) \mathrm{d}u + \int_0^{W_t} \partial_t\sigma_u(t) \mathrm{d}W_u\right)\mathrm{d}t + \sigma_t(t)\mathrm{d}W_t $$
And hence this is the full derivation of the stochastic differential equation.