Finding the Derivative of an Expected Value. Is it possible to find the derivative of an expression inside the expectation operator $ \mathbb{E}[\cdot] $? I have an expression that reads
$$
\mathbb{E} \left[ \left[ \log(A_{k}) - \log(\hat{A_{k}}) \right]^{2} ~ \Bigg| ~ (y_{t})_{0 \leq t \leq T} \right]\cdots \cdots \cdots (1)
$$
which needs to be minimised.
Then it says: The estimator is easily shown to be
$$
\hat{A_{k}} = \exp \left( \mathbb{E} \left[ \log(A_{k}) ~ \Big| ~ (y_{t})_{0 \leq t \leq T} \right] \right)\cdots \cdots \cdots (2)
$$
How can this be shown? Thanks!
--------EDIT--------
I have one more question
The equations said that the log in equation 2 is natural log (ln) while it is independent of the log base used in equation 1. Could you please tell me the reason for that?
Thank you very much
--------EDIT 2--------
Something related:
Expected value and Variance
 A: One is looking for the value $a$ which yields the minimal
$$
L(a)=\mathbb E((\log A_k-\log a)^2\mid y_t,t\leqslant T).
$$
This assumes that $(\log A_k)^2$ is integrable, otherwise the function $L$ would be infinite everywhere. In such a context Lebesgue differentiation theorem indicates that indeed,
$$
\frac{\mathrm d}{\mathrm da}\mathbb E(G(A_k,a))=\mathbb E\left(\frac{\partial}{\partial a}G(A_k,a)\right).
$$
Here,
$$
L'(a)=-\frac2{a}\mathbb E(\log A_k-\log a\mid y_t,t\leqslant T)=-\frac2{a}\left(\mathbb E(\log A_k\mid y_t,t\leqslant T)-\log a\right),
$$
hence $L'(a)=0$ if and only if
$$
\log a=\mathbb E(\log A_k\mid y_t,t\leqslant T),
$$
that is,
$$
a=\exp\left(\mathbb E(\log A_k\mid y_t,t\leqslant T)\right).
$$
Edit: The reasoning above applies to every (differentiable) function $L$. In the present case, one can note that $a\mapsto L(a)$ is a quadratic polynomial in $\log a$, namely,
$$
L(a)=\mathbb E((\log A_k)^2\mid y_t,t\leqslant T)-2\mathbb E(\log A_k\mid y_t,t\leqslant T)(\log a)+(\log a)^2.
$$
Since the polynomial $x\mapsto\gamma-2\beta x+x^2$ is minimal when $x=\beta$, the likelihood $a\mapsto L(a)$ is minimal when $\log a=\mathbb E(\log A_k\mid y_t,t\leqslant T)$.
