I have been self-studying probability and measure theory. The condition I have for the interchange of derivative and integral is as follows, and comes from Folland, G. B. (1999). Real analysis: modern techniques and their applications (Vol. 40). John Wiley & Sons.
Let
\begin{align*}
& f : \mathcal{X} \times [a,b] \to \mathbb{R}, && \text{ where } (-\infty < a < b < \infty) \\
& f(\cdot, t) : \mathcal{X} \to \mathbb{R} \text{ be integrable} && \forall t \in [a,b] \\
&F(t) := \int_{\mathcal{X}} f(x,t) \; d\mu(x) \\
& \partial f / \partial t \quad \text{exist} \\
& \bigg|\frac{\partial f}{\partial t}(x,t)\bigg| \leq g(x) \qquad \forall x,t \qquad \text{for some integrable} \; g
\end{align*}
Then $F$ is differentiable and $$ F'(t) = \int_{\mathcal{X}} \frac{\partial f}{\partial t}(x,t) \; d\mu(x) $$
This theorem may seem overly restrictive, since the real-valued parameter has bounded support. However, as noted by Folland (1999) pp. 56, continuity and differentiability are local in nature. Thus, if the hypotheses of (a) or (b) hold for all $[a,b] \subset I$ of an open interval $I$ (which is perhaps $\mathbb{R}$ itself), perhaps with the dominating function $g$ depending on $a$ and $b$, one obtains the continuity and differentiability of the integrated function $F$ on all of $I$!
Now I would like to practice using this theorem to justify the exchange of a derivative and expectation in a simple setting. To accomplish this, I have come up with the following simple problem, which is inspired by problems in which one finds the ``best" (in a mean squared sense) predictor of a random variable.
Let $X$ be a random variable with mean 0 and variance $\sigma^2$. Show that $$ \frac{\partial}{\partial a} \mathbb{E}[(X-a)^2] = \mathbb{E}[\frac{\partial}{\partial a} (X-a)^2]. $$
And here is my attempt at a justification.
We first identify a dominating function for the derivative of the integrand.
\begin{align*} |-2 (X-a)| \leq |2X| + |2a| \leq 2 (|X| + \sup_{a \in I} |a|) \end{align*}
where we have applied the triangle inequality, and where $I$ is some closed interval in $\mathbb{R}$. Now we show that the dominating function is integrable:
\begin{align*} \mathbb{E} \bigg[ |X| + \sup_{a \in I} |a| \bigg] \leq \sigma + \sup_{a \in I} |a| < \infty \end{align*}
where I have used that the standard deviation gives an upper bound on an expected absolute value.
My question: Is my justification correct?