A question of formula derivation

Best wishes to everyone!
When I am deriving the fomulars in [ Tae-Seok, Eiji, 2013, Productivity shocks and monetary policy in a two-country model, Dynare working papers ], I feel confuse of the following question:

Where did the P(H,t+k) colored in blue come from? (as showed in the picture below)


PS:Here use calvo’s way of sticky price and seller cannot change its price with a given probability of θ.

Here is my process of calculability, I use a way learned in class. I cannot get the P(H,t+k) colored in blue.

Here is the paper:(the fomular is in page 10)
3.Tae-Seok, Eiji, 2013, Productivity shocks and monetary policy in a two-country model, Dynare working papers.pdf (348.3 KB)

Thanks for any suggestion and help!

I guess it has to do with the definition of marginal costs. You seem to have set up a nominal Lagrangian as revenue is price times quantity P_HY_H. But then you need to subtract nominal costs as well. If MC is real marginal costs, then Y_HMC_H is still real.

It seems to me you are starting with a FOC, see page 13

Thank you for your help!
I am also confused about the derivation of MC, so I don’t know whether MC is real marginal cost.
Can MC be set to any form I want? Or I can get the form by derivation from certain fomulars?
I try to get MC by using the way I learned in RBC model but I failed.

Thank you for your suggestion!
The fomular showed in page13 is familiar with what I want. But I can’t get the goal by repeating the process after the fomular. It seems that Q and Y are replaced in the following process which is different from my goal

It says explicitly in the screenshot you posted that MC is real marginal costs. You highlighted that part.

Thank you for your help, professor jpfeifer!