# Expectation of two independent random variables

I would like to compute the following function of two independent random variables:

Expectation[
1 - Exp[-ρ ((K (1 + s*K^(β - 1)*ϵ) - c*s*K))], {
c \[Distributed] NormalDistribution[Subscript[μ, c], Subscript[σ, c]],
ϵ \[Distributed] NormalDistribution[Subscript[μ, r], Subscript[σ, r]]}]


However, it seems Mathematica can not compute it.

What version are you using? It works just fine on my 11.3 installation:

In[2]:= Expectation[1-Exp[-\[Rho] ((K (1+s*K^(\[Beta]-1)*\[Epsilon])-c*s*K))],{c\[Distributed]NormalDistribution[Subscript[\[Mu],c],Subscript[\[Sigma],c]],\[Epsilon]\[Distributed]NormalDistribution[Subscript[\[Mu],r],Subscript[\[Sigma],r]]}]


Out[2]= 1-E^(1/2 [Rho] (-2 K+2 K s Subscript[[Mu], c]-2 K^[Beta] s Subscript[[Mu], r]+K^2 s^2 [Rho] Subsuperscript[[Sigma], c, 2]+K^(2 [Beta]) s^2 [Rho] Subsuperscript[[Sigma], r, 2]))

Some general pointers though:

1. Specify Assumptions if symbolic computations are failing. Very often Mathematica needs to know that certain variables are real or positive rather than complex-valued
2. Do not use Subscript for variables/parameters in symbolic computations. Sometimes it works (like it did just now), but often enough it won't and it's just not worth the bother. It's better to stick with normal symbols most of the time. See also: Can we use letter with a subscript as a variable in Mathematica?
• It doesn't work as is on version 10.4. But if one follows your good advice about avoiding Subscript, it works fine on 10.4.
– JimB
Commented Apr 3, 2019 at 14:25
• Most thanks Sjoerd Smit and JimB for your very helpful advices!!! Indeed, it works perfectly w/o Subscript! Commented Apr 4, 2019 at 6:45