Comparative statics for conditional expectations Let $f\left(x,y\right)\in\left[0,\frac{1}{2}\right)$ a function such that $\frac{\partial f}{\partial x}>0$, $\frac{\partial f}{\partial y}<0$, and $\frac{\partial^2 f}{\partial x \partial y}<0$.
Further, let $\pi$ a random variable over $\left[0,1\right]$ with density $h(\pi)$. I would like to know if:
$$\frac{\partial^2 \mathbb{E}\left[\pi \mid \pi>\frac{1}{2}-f\left(x,y\right)\right]}{\partial x\partial y}>0$$.
My computations so far:
$$\mathbb{E}\left[\pi \mid \pi>\frac{1}{2}-f\left(x,y\right)\right]=\int_{\frac{1}{2}-f\left(x,y\right)}^1 \pi h\left(\pi\right)d\pi=H\left(1\right)-H\left(\frac{1}{2}-f\left(x,y\right)\right),$$
where $H$ is a primitive of $\pi h\left(\pi\right)$. Then,
$$\frac{\partial \mathbb{E}\left[\pi \mid \pi>\frac{1}{2}-f\left(x,y\right)\right]}{\partial x}=\left[\frac{1}{2}-f\left(x,y\right)\right]\times h \left(\frac{1}{2}-f\left(x,y\right)\right) \times \frac{\partial f\left(x,y\right)}{\partial x}$$.
Am I missing something here? It seems I need to know something more about $h\left(\cdot\right)$ to say something after taking the $y$ derivative.
In my application, $\pi$ is a probability itself arising from updating beliefs about a Markov chain -- it's a bit complicated to do more with its density. Thanks!
 A: Your working appears to me to have a few errors.  I will show you how to get as far as the first partial derivative, which should illustrate the general methods to use to allow you to get the second partial derivative.  To facilitate this analysis, I will use the function:
$$A_k(x,y) \equiv \mathbb{E}(\pi^k \cdot \mathbb{I}(\pi > \tfrac{1}{2}-f(x,y))) = \int \limits_{1/2-f(x,y)}^\infty \pi^k h(\pi) \ d\pi.$$
For the conditional expectation you should have a ratio of integrals, which can be written as follows:
$$\begin{align}
\mathbb{E} \bigg[ \pi \bigg| \pi > \tfrac{1}{2}-f(x,y) \bigg]
&= \frac{\mathbb{E} [ \pi \cdot \mathbb{I}(\pi > \tfrac{1}{2}-f(x,y))]}{\mathbb{P} [\pi > \tfrac{1}{2}-f(x,y)]} \\[6pt]
&= \frac{\int_{1/2-f(x,y)}^\infty \pi h(\pi) \ d\pi}{\int_{1/2-f(x,y)}^\infty h(\pi) \ d\pi} \\[6pt]
&= \frac{A_1(x,y)}{A_0(x,y)}. \\[6pt]
\end{align}$$
(Your own expression incorrectly leaves out the denominator for the probability of the conditioning event.)  For the derivative you should first apply Leibniz integral rule to get:
$$\begin{align}
R_0(x,y) 
&\equiv \frac{\partial A_0}{\partial x} (x,y) \\[10pt]
&= - h(\tfrac{1}{2}-f(x,y)) \frac{\partial }{\partial x} (\tfrac{1}{2}-f(x,y)) \\[12pt]
&= h(\tfrac{1}{2}-f(x,y)) \frac{\partial f}{\partial x} (x,y), \\[6pt]
R_1(x,y) 
&\equiv \frac{\partial A_1}{\partial x} (x,y) \\[10pt]
&= - (\tfrac{1}{2}-f(x,y)) h(\tfrac{1}{2}-f(x,y)) \frac{\partial }{\partial x} (\tfrac{1}{2}-f(x,y)) \\[6pt]
&= (\tfrac{1}{2}-f(x,y)) h(\tfrac{1}{2}-f(x,y)) \frac{\partial f}{\partial x} (x,y). \\[6pt]
\end{align}$$
You can then use the quotient rule to get:
$$\begin{align}
G(x,y) &\equiv \frac{\partial }{\partial x}
\mathbb{E} \bigg[ \pi \bigg| \pi > \tfrac{1}{2}-f(x,y) \bigg] \\[10pt]
&= \frac{\partial }{\partial x}
\frac{A_1(x,y)}{A_0(x,y)} \\[10pt]
&= \frac{A_0(x,y) R_1(x,y) - R_0(x,y) A_1(x,y)}{A_0(x,y)^2} \\[6pt]
&= \frac{A_0(x,y) (\tfrac{1}{2}-f(x,y)) - A_1(x,y)}{A_0(x,y)^2} \cdot h(\tfrac{1}{2}-f(x,y)) \cdot \frac{\partial f}{\partial x} (x,y) \\[6pt]
&= \bigg[ \frac{(\tfrac{1}{2}-f(x,y))}{A_0(x,y)} - \frac{A_1(x,y)}{A_0(x,y)^2} \bigg] \cdot h(\tfrac{1}{2}-f(x,y)) \cdot \frac{\partial f}{\partial x} (x,y). \\[6pt]
\end{align}$$
This gives you the first partial derivative of the conditional expectation function.  You can extend this technique to get the second partial derivative.
