Differentiating an Expected Square Root with a Parameter-Dependent Density
Summary
The document examines the derivative of E[√(a + X)] when X is positive and a is nonnegative, using a finance-motivated question to expose an apparent contradiction between two integral approaches. Differentiating under the integral with X’s fixed density gives a positive expectation involving 1/√(a + X), assuming the required integrability conditions hold.
The alternative approach changes variables to the transformed random variable Y = √(a + X). Its density depends on a, so treating that density as fixed while differentiating leads to the error. The answers clarify the density transformation through the cumulative distribution and show that rewriting the expectation in transformed coordinates returns to the original integral. The discussion is conceptual rather than a full theorem: it does not establish all regularity conditions for differentiation under the integral, and the question’s proposed density notation is ambiguous.
Key ideas
- The density of √(a + X) changes when a changes.
- A derivative that holds the transformed density fixed omits its dependence on the parameter.
- The transformed density follows from the cumulative distribution and a change of variables.
- Differentiating the original expectation gives a positive integral when the differentiation is justified.
Tags
Full text
# $\frac{\partial}{\partial a} E [\sqrt{a+X} ]$, $X > 0$ a.s., $a \geq 0$
# $\frac{\partial}{\partial a} E [\sqrt{a+X} ]$, $X > 0$ a.s., $a \geq 0$
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.
## Answer by ir7 (score 3, accepted)
https://quant.stackexchange.com/a/57375
I'm not sure what your $q$ is (it doesn't seem well defined). For clarity, let $$ Y = \sqrt{a+X} > \sqrt a \; \; a.s. $$
For cdf's we have: $$ F_Y(y) = P(Y\leq y) = P(\sqrt{a+X}\leq y) = P(X\leq y^2-a)=F_X(y^2-a) $$
By taking derivatives, we get the following relationship between pdf's:
$$ p_Y(y) = 2y p_X(y^2-a) $$
So:
$$E[Y] = \int_{\sqrt{a}}^\infty y p_Y(y) dy =\int_{\sqrt{a}}^\infty 2y^2 p_X(y^2-a) dy $$ $$= \int_{{0}}^\infty \sqrt{a+x}p_X(x) dx = E[\sqrt{a+X}]$$
(after a variable transformation $x=y^2-a$ in the third equality).
We then may want to take the derivative wrt to $a$ of: $$E[Y] = \int_{\sqrt{a}}^\infty y p_Y(y) dy = \int_{{0}}^\infty 2^{-1}p_Y(\sqrt{z+a}) dz $$
(after transformation $y=\sqrt{z+a}$), which brings us back to square 1 (given the pdf relationships).
## Answer by CABLE (score 2)
https://quant.stackexchange.com/a/57370
Your last claim $\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})$ is not true.
Realized that the part above is irrelevant. Assuming $q$ is nice enough, the problems lies in the part of taking derivative $\frac{\partial q(\sqrt{a+x})}{\partial a}$. The mistake is that $q_a(y) = q(a, y)$ itself is also a function of $a$. So when taking derivative, we need take care of both arguments.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.