i 'm working on writing program to solve my problem about conditional expected value, there is few equations that i need to rewrite it. one of them is in the attachment. For EQ1, i can write code to solve it easily but for EQ2, how can i rewrite it so that the equation does not involve the infinity sign. please give me some suggestions.

Best Regards

Rami