# Thread: Differentiating an integral of a random variable

1. ## Differentiating an integral of a random variable

Hello,

I have a problem which I spent some time trying to solve and simply cannot do that. I will greatly appreciate help and/or direction to resources from where I can learn needed math.

I have a random variable Y which is uniformly distributed between -0.5 and 0.5. And a function f(X)= (Z + Y - X)^2. I need to maximize this function with respect to X and find solution which is a function itself: X(Z). Z is a variable I can assign any value and draw X(Z). X and Y are dependent.

I know that once I take expectations of this function f(X) I will have an integral with respect to the distribution function of Y. Is that correct? And then I need to find the first order condition differentiating this integral?

How to write this integral properly and how to differentiate it properly? How will the F.O.C. look like?

Hope to hear from you..

best
pingwin3

2. ## Maximization with respec to a function of random variable

Hi

I need to solve this probelm and will greatly appretiate help.

$max F(x)=E[Z+Y-2X]+E[(Z+Y-X)^2]$

I need to amximize this above function with respect to X, where Y is a uniformly distributed variable between -0.5 and 0.5. X is dependent somehow on Y. Z is another variable not important since the solution to this problem should be $X(Z)$.
I know that this solution will be dependen somehow on the probability distribution of Y, but I do not kow how to obtain the F.O.C. and how to differentiate the integral (the expectation of this function).

The more detailed help the better!
pingwin3

Thanks