# Differentiating over multiple time horizons to get FOCs

First of all, I'd like to say sorry if I couldn't be more specific in the title, I really tried to synthesize the core of my doubt.

I was reading The Econometric Analysis of Calibrated Macroeconomic Models, by K. Kim and A.R. Pagan (present in the book Handbook of Applied Econometrics, Volume 1: Macroeconomics) and, in order of constructing some steady state variables, they introduce us to an expected utility function (1) and to a production function (2), which is our constraint for the maximization problem of (1):

$$E_t\left\{\sum_{j = 0}^\infty \beta^j U(C_t, (1 - L_t)) \right\} = E_t \left\{ \sum \beta^j [(1 - \sigma)^{-1} C_t^{\theta(1 - \sigma)} ( 1 - L_t)^{(1 - \theta)(1 - \sigma)}] \right\}$$ $$(1)$$

$$Y_t = A_t K_t^\alpha L_t^{1 - \alpha} = A_t F(K_t, L_t)$$ $$(2)$$

It is introduced as well a law of motion of capital (3):

$$K_{t+1} = (1 - \delta) K_t + I_t$$ $$(3)$$

Then, we can formulate the lagrangian:

$$\mathcal{L} = E_t \sum \beta^j \left\{ [(1 - \sigma)^{-1} C_t^{\theta(1 - \sigma)} ( 1 - L_t)^{(1 - \theta)(1 - \sigma)}] + \lambda_t [ A_tF(K_t, L_t) - C_t - K_{t+1} + (1 - \delta)K_t - G_t] \right\}$$ $$(4)$$

The lagrangian above is used to choose the First Order Conditions (FOCs) for $$C_t$$, $$L_t$$, $$K_{t+1}$$ and $$\lambda_t$$.

I will skip to $$K_{t+1}$$'s FOC because it is exactly where my doubt lies. Its FOC is presented by:

$$E_t \left\{ \beta \lambda_{t + 1}[ {A_{t+1} F_K + (1 - \delta)]} - \lambda_t \right\} = 0$$ $$(5)$$

I tried using the rationale of shifting every time dependent variable one time period ahead and then calculating the FOC, but my calculation still doesn't match this result in $$(5)$$.

If it is some trivial arithmetic or calculus step that I am missing, I'd already be glad if someone could point me where I could find something similar in detail so I could figure it out on my own.