Log-linearization of Euler equation with an expectation term There are a few online resources available to help with log-linearization (e.g., here  or here). However, log-linearization where an expectation is involved
is a little tricky because the log can't simply "pass through" the expectation operator.
Could somebody help with the algebra in this example?

I have the Euler equation (equation 1)
$$
1 = E_t \left [ \left \{ \delta \left (\frac{C_{t+1}}{C_t} \right )^{-1/\psi}
\right \}^\theta
\left \{ \frac{1}{1 + R_{m,t+1}} \right \}^{1 - \theta} 1 + R_{i, t+1}
\right ]
$$
where $\theta = ( 1 -\gamma)/(1 - 1/\psi)$. I'm trying to derive an expression for
the risk-free rate and an expression for the equity premium. How should I go about doing this?

It seems from the second link above that I should start by replacing the
variables of interest like so $C_t = c e^{\tilde C_t}$. Then following the steps given,
it seems like I should arrive at (equation 2)

\begin{align}
1 = E_t \left [ 
\left \{ \delta \left (\frac{\tilde C_{t+1} + 1}{\tilde C_t + 1} \right )^{-1/\psi}
\right \}^\theta
{}
\left \{ \frac{1}{(1 + R_m)[\widetilde{(1 + R_{m,t+1})} + 1]} \right \}^{1 - \theta} \cdot \\
\cdot
[(1 + R_i)[\widetilde{(1 + R_{i, t+1})} + 1]]
\right ].
\end{align}

But where do I go from here?

EDIT:


I have copied equation 1 directly from the notes that I have. It is probably the case that the term on the right, $1 + R_{i,t+1}$, should be in parentheses, $(1 + R_{i,t+1})$. In my initial attempt at log-linearization I have treated it this way.
In equation 2, I have followed the steps in the instruction that can be found in the second link at the beginning. So, $R_i$ and $R_m$ without time subscripts are these values in the steady state. 
$R_m$ is the return on the market portfolio and $R_i$ is the return on asset $i$.


EDIT 2:

Thanks for the useful comments.
So, from what I have gathered so far, I should get something like this:

\begin{align}
1 &amp;= E_t
\left [
  \delta^\theta (1 - \frac \theta \psi (\tilde C_{t+1} - \tilde C_t )
  (1 + R_m)^{\theta - 1} (\theta - 1)
  \left (
    1 + \tilde R_{m,t}  \frac{R_m}{1 + R_m}
  \right ) \right .\\
  &amp; \left . \, \cdot
  (1 + R_i)
  \left (
    (1 + \tilde R_{i,t} \frac{  R_i}{1 + R_i}
  \right )
\right ]
\end{align}

Then this would imply that the risk-free rate is found as follows:

\begin{align}
1 &amp;= E_t
\left [
  \delta^\theta (1 - \frac \theta \psi (\tilde C_{t+1} - \tilde C_t )
  (1 + R_m)^{\theta - 1} (\theta - 1)
    \left (
    1 + \tilde R_{m,t}  \frac{R_m}{1 + R_m}
    \right ) 
  (1 + R_f)
\right ] \\
1 &amp;= E_t[ m_{t+1} (1 + R_f)] \\
\frac{1}{E_t[m_{t+1}]} &amp;= 1 + R_f.
\end{align}

Is this correct? And now, to finish the question, how would I find the 
equity premium?
Let's ignore for the moment the existence of the expected value. If this was a deterministic set-up, linearization through taking logs would be straightforward, and without the tricks of the links the OP provided. Taking natural logs on both sides of the first equation we obtain:

$$0 = \theta \ln \delta-\frac {\theta}{\psi}\ln \left (\frac{C_{t+1}}{C_t} \right )-(1-\theta) \ln(1 + R_{m,t+1}) + \ln (1 + R_{i, t+1}) \tag{1}$$

Set 

$$\hat c_{t+1} = \frac{C_{t+1}-C_t}{C_t} \Rightarrow \frac{C_{t+1}}{C_t} = 1+\hat c_{t+1} \tag{2}$$

Also, note that it is standard approximation to write $\ln (1+a) \approx a$ at least for $|a|&lt;0.1$. Usually this is the case with growth rates and financial rates so we obtain

$$0 = \theta \ln \delta-\frac {\theta}{\psi}\hat c_{t+1} -(1-\theta) R_{m,t+1} + R_{i, t+1} \tag{3}$$

which is a clear dynamic relation that links the three variables present.
If in the model, the steady-state is characterized by constant consumption and constant returns, then at it we will have $\hat c_{t+1} =0$ and so the steady-state relation will be 

$$R_{i} = - \theta \ln \delta + (1-\theta) R_{m} \tag{4}$$

But we did all these ignoring the expected value. Our expression is $E_t\left[f\left(C_t, C_{t+1},R_{m,t+1},R_{i,t+1} \right)\right]$, not just  $f\left(C_t, C_{t+1},R_{m,t+1},R_{i,t+1} \right)$. Enter first-order Taylor expansion of $f()$. We need a center of expansion. Represent the four variables simply by $\mathbf z_{t+1}$ (it doesn't hurt that a variable with $t$-index is present in $\mathbf z_{t+1}$). We choose to expand the function around $E_t(\mathbf z_{t+1})$. So

$$f\left(\mathbf z_{t+1}\right) \approx  f\left(E_t[\mathbf z_{t+1}]\right) + \nabla f\left(E_t[\mathbf z_{t+1}]\right)\cdot \big(\mathbf z_{t+1}-E_t[\mathbf z_{t+1}]\big) \tag{5}$$

Then

$$E_t\left[f\left(\mathbf z_{t+1}\right)\right] \approx f\left(E_t[\mathbf z_{t+1}]\right) \tag{6}$$

Obviously this is an approximation, i.e. it has error, even if only because of Jensen's inequality. But it is standard practice. Then we see that all the previous work we did on the deterministic version, can be applied in the stochastic version inserting conditional expected values in place of the variables. So eq. $(3)$ is written 

$$0 = \theta \ln \delta-\frac {\theta}{\psi}E_t[\hat c_{t+1}] -(1-\theta) E_t[R_{m,t+1}] + E_t[R_{i, t+1}] \tag{7}$$

But where are the steady-state values? Well, steady state values in a stochastic context are a bit tricky -are we arguing that our variables (which are now treated as random variables) become constants? Or is there another way to define a steady-state in a stochastic context?  

There are more than one ways. One of them, is the "perfect foresight steady state", where we forecast perfectly a not-necessarily constant value (this is the concept of "equilibrium as fulfilled expectations"). This is for example used in Jordi Gali's book mentioned in a comment. "Perfect-foresight steady state" is defined by
$$E_t(x_{t+1}) = x_{t+1} \tag{8}$$

Under this concept, eq. $(7)$ becomes eq. $(3)$ which is now the "perfect-foresight stochastic steady state" equation of the economy.

If we want a stronger condition, saying that variables become constant in the steady-state, then it is also reasonable to argue that, again, their forecast will eventually be perfect. In that case, the steady-state of the stochastic economy is the same as that of the deterministic economy, i.e. eq. $(4)$.