I'm trying to compute expectation of a piecewise function which it's random variable is a piecewise function too! Problem is that limits of each piece is variable.
Intractability of integrand is not important for now, but just how to define limits of this integral. Making long statement short, problem formulation is: $$E\{G(r)\}=?$$ where $$G(r) = \begin{cases} \frac{A}{r^v}, & \text{if $\; r\le R_{th-1} \; $ } \\[2ex] \frac{1}{r^v}\times10^{-1.2(\frac{-\tan^{-1}(\frac{H}{r})+\beta}{\theta_{3dB}})^2}, & \text{if $R_{th-1} \le r<R_{th-2}$ } \\ \\ \frac{A}{r^v}, & \text{if $\; R_{th-2}\le r \; $ } \\[2ex] \end{cases}$$ and $H,\beta,\theta_{3dB},A$ all are known constants. $v \in \mathbb R^+$ is a known number. On the other hand $R_{th-1},R_{th-2}$ are unknwown and the only thing that we know is that $R_{th-1}<R_{th-2}$.
PDF of $r$ also is $$f_r(x)= \begin{cases} 0, &\text{if $\; x<\frac{d\sqrt3}{2}\;$} \\ \frac{4x}{\sqrt{3}d^2}\cos^{-1}(\frac{d\sqrt3}{2x}), & \text{if $\; \frac{d\sqrt3}{2} \le x < d$} \\ \frac{\pi x}{\sqrt3 d^2}-\frac{2x}{\sqrt{3}d^2}\cos^{-1}(\frac{d\sqrt3}{2x}), & \text{if $\; d \le x < \sqrt3 d$} \\ \frac{\pi x}{3\sqrt3 d^2}-\frac{2x}{\sqrt{3}d^2}\cos^{-1}(\frac{d\sqrt3}{x}), & \text{if $\; \sqrt3d \le x < 2 d$} \\ 0, & x>2d \end{cases}$$ where $d$ is another known constant.
-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
Update: the result of above expectation is going to be used in an optimization problem. Consider $R_{th-1}=\frac{H}{\tan(\beta+\theta \sqrt{\frac{S_{ll}}{12}})}$ and $R_{th-2}=\frac{H}{\tan(\beta-\theta \sqrt{\frac{S_{ll}}{12}})}$. We assume that $\beta-\theta \sqrt{\frac{S_{ll}}{12}}>0 $.
$S_{ll}=20 $ is side lobe level and is a constant.
So indeed $\beta$ is not constant and is variable but for a given value of $\beta$ all the above mentioned variables are constant. We can do a grid search on the interval of $\beta$ to find the optimal value $\beta^{opt}$ but to do so, for each value of $\beta$ the expectation must be evaluated and be substituted in objective function.
Any HELP is appreciated, literally.
Thanks in advance.