Let $X$ and $Y$ be independent exponential random variables with mean 1. (a) Explain how we could use simulation to estimate $E[e^{XY}]$. (b) Show how to improve the estimation approach in part (a) by using a control variate.
The red box (see screenshot) in the book solution makes sense to me.
I don't understand the blue box. It seems to me the blue box estimator will not have the same expected value as $E[e^{XY}]$ and is missing a "$-c$" in the numerator because $E[X_i Y_i] = E[X_i] E[Y_i] = 1$
So I think the blue box should actually be
$$\sum_{i=1}^n \frac{e^{X_i Y_i} + c X_i Y_i - c}{n}$$
Will the blue box estimator have the same expected value as $E[e^{XY}]$? Thanks for your help I'm learning about control variates for the first time.
Book Solution

Yes, for $c \in \mathbb{R}$ the first should be $$\frac{1}{n}\sum_{i=1}^n[e^{X_iY_i} + c\underbrace{(X_iY_i-1)}_{\mbox{mean 0}}]$$ and also the second should be $$\frac{1}{n}\sum_{i=1}^n[e^{X_iY_i} + c\underbrace{(X_iY_i + X_i^2Y_i^2/2 - 3)}_{\mbox{mean 0}}]$$ Using $c=-1$ seems to be a good choice for reducing variance.