# Derive optimal wage in New Keynesian-Calvo wage stickiness

Following Costa, 2016 in page 96, developing the labor variety optimal wage decided by the household, the FOC is:

$$0=E_t\sum_{i=0}^\infty(\beta\theta_w)^{t+i}\left\{\psi_W\left[L_{t+i}\left(\frac{W_{t+i}}{W_{j,t}^\ast}\right)^{\psi_W}\right]^\varphi L_{t+i}\left(\frac{W_{t+i}}{W_{j,t}^\ast}\right)^{\psi_W}\left(\frac{1}{W_{j,t}^\ast}\right)+(1-\psi_W)\lambda_{t+i}L_{t+i}\left(\frac{W_{t+i}}{W_{j,t}^\ast}\right)^{\psi_W}\right\}$$

I can reach this equation, nevertheless in the next equation from the book, the term $$\left(\frac{W_{t+i}}{W_{j,t}^\ast}\right)^{\psi_W}L_{t+i}$$ is factored and cancelled out since the other side of the equation is $$0$$. My question is whether this is valid, since $$W_{t+i}$$ and $$L_{t+i}$$ are functions of the infinite series since they're indexed with $$i$$, then I would like to know if this is algebraically valid, or if it's a mathematical typo. And if it's valid, how can I derive the next equation, where the mentioned terms are cancelled out.

Thanks!

PD: If it helps:

-This is how $$L_{j,t+s}$$ is defined: $$L_{j,t+s}=L_{t+s}\left(\frac{W_{t+s}}{W_{j,t}^\ast}\right)^{\psi_W}$$.

-$$W_{j,t}^\ast$$ is not a function of the summation (check the indexes).

-The idea is to obtain a closed expression for $$W_{j,t}^\ast$$.