Although maybe this could have been posted at cross-validated, I actually have a financial application in mind.
Problem:
There is a very elementary mistake somewhere, but I can't see it:
Let $X$ be a random variable with $X > 0$ almost surely. Let $a$ be a non-negative real-number. Denote by $p(x)$ the probability density of $X$. Then, $$ E [\sqrt{a + X} \;] = \int_0^\infty \sqrt{a+x}\; p(x) dx $$ and $$ \frac{\partial}{\partial a} E [\sqrt{a+X}\; ] = \frac{1}{2}\int_0^\infty \frac{1}{\sqrt{a+x}}\; p(x) dx > 0 $$
On the other hand, we can also consider the probability density $q(\sqrt{a+x})$ of the random variable $\sqrt{a+X}$ directly, and since $\sqrt{a+X} > \sqrt{a}$ almost surely, $$ E [\sqrt{a + X} \;] = \int_\sqrt{a}^\infty \sqrt{a+x}\; q(\sqrt{a+x}) d\sqrt{a+x} $$ Now, $$ d\sqrt{a+x} = \frac{1}{2} \frac{dx}{\sqrt{a+x}} $$ and hence $$ E [\sqrt{a + X} \;] = \frac{1}{2} \int_0^\infty q(\sqrt{a+x}) dx $$ Differentiate the above expressiont wrt to $a$: \begin{align} \frac{\partial}{\partial a} E [\sqrt{a + X} \;] &= \frac{1}{2} \int_0^\infty \frac{1}{2\sqrt{a+x}} \frac{\partial q(\sqrt{a+x})}{\partial \sqrt{a+x}} dx\\ &= \frac{1}{2} \int_\sqrt{a}^\infty \frac{\partial q(\sqrt{a+x})}{\partial \sqrt{a+x}} d\sqrt{a+x} \\ &= - \frac{1}{2} q(\sqrt{a}) \end{align}
Since 1. the sign is wrong, and 2. $q(\sqrt{a}) = 0$, this is (twice) in contradiction with what was derived earlier, namely, $$ \frac{\partial}{\partial a} E [\sqrt{a+X}\; ] = \frac{1}{2}\int_0^\infty \frac{1}{\sqrt{a+x}}\; p(x) dx > 0 $$
So where did I go wrong?
Thanks.