I have a question concerning a derivation of a marginal log-Likelihood function that I found in a paper and that I do not understand. It's pretty basic so sorry for this in advance.
Assume that the marginal Likelihood of object $i$ is given by
$f(e_i) = \int_{\theta} f(e_i|\theta)g(\theta)\, d\theta$
and the Likelihood for $N$ objects is $L = \Pi_{i = 1}^{N} f(e_i)$. Set $f(e_i) = f_i, c_i = f(e_i|\theta)$, and $g(\theta) = g$.
We are interested in estimating parameters that are in $c_i$. It may be important that $\theta$ is a two-dimensional vector. We therefore consider the log-Likelihood given by
$\ln L = \sum_{i=1}^{N} \ln(f_i) = \sum_{i=1}^{N} \ln \left[ \int_{\theta} (c_i \cdot g )\,d\theta \right]$
In the paper they say that the first derivative of $\ln L$ concerning a parameter vector $\eta$ is given by
$\frac{\partial \ln L}{\partial \eta} = \sum_{i=1}^{N} \frac{1}{f_i} \int_{\theta} \left[ \frac{\partial \ln(f_i)}{\partial \eta} \cdot f_i \cdot g \right] \, d\theta$
My question is how one arrives at this derivation. The first part of the derivation, i.e., $\frac{1}{f_i}$ seems to be an application of the chain rule. But in this case one would also need the derivation of
$\frac{\partial }{\partial \eta} \int_{\theta} f(e_i|\theta)g(\theta) \, d\theta$ which does not seem to involve another logarithm so I would not end up with $\frac{\partial \ln(f_i)}{\partial \eta}$ within the integral. Are the authors using another rule? I would be happy, if you could give me a hint.