# Derivative of the expected value of the truncated normal distribution wrt upper limit

I am looking for the derivative of the expected value of the truncated normal distribution with respect to one of the upper limits. It looks like this: $$f=\frac{1}{\sqrt{\vert T \vert} (2\pi)^{3/2}} \int_{-\infty}^{x_3=a_3} dx_3 \int_{-\infty}^{x_2=a_2} dx_2 \int_{-\infty}^{x_1=a_1} dx_1 \begin{bmatrix}{x_1\\x_2\\x_3}\end{bmatrix} exp\bigg(-0.5\begin{bmatrix}{x_1 x_2 x_3}\end{bmatrix} T^{-1} \begin{bmatrix}{x_1\\x_2\\x_3}\end{bmatrix} \bigg)$$\ $$\frac{\partial f}{\partial a_2}?$$

I have tried using the Fundamental Theorem of Calculus but I am a bit stuck what to do with the other integrals and elements of the vectors.

The answer is $$$$\frac{\partial f}{\partial a_2}=\frac{1}{\sqrt{\vert T \vert} (2\pi)^{3/2}} \int_{-\infty}^{x_3=a_3} dx_3 \int_{-\infty}^{x_1=a_1} dx_1 \begin{bmatrix}{x_1\\a_2\\x_3}\end{bmatrix} exp\bigg(-0.5\begin{bmatrix}{x_1 a_2 x_3}\end{bmatrix} T^{-1} \begin{bmatrix}{x_1\\a_2\\x_3}\end{bmatrix} \bigg).$$$$
Consider the antiderivative $$F(x)$$ of the function $$$$F(x) = \int f(x) dx$$$$ or $$$$\frac{d F(x)}{dx} = f(x),$$$$ so definite integral is the difference of antiderivatives $$$$\int\limits_a^b f(x)dx = F(b) - F(a),$$$$ i.e. the derivative is $$$$\frac{\partial}{\partial b} \int\limits_a^b f(x)dx = F^{\prime}(b) = f(b).$$$$