Simplifying the expectation of an exponent Although the steps seem short, it is not clear to me how the underlined expression in the figure below was gotten. Any hint(s) that could help? 
Because $\text g \sim exp (1)$, the expectation term is obtained as


 A: You need three facts. Suppose $X \sim \text{Exponential}(\lambda)$ (where $\mathbb{E}[X] = \dfrac{1}{\lambda}$), $\lambda \neq 0$.
(1) For $x \geq 0$, $\mathbb{P}(X \leq x) = 1-e^{-\lambda x}\text{.}$
Proof. 
$$\mathbb{P}(X \leq x) = \int_{0}^{x}\lambda e^{-\lambda t}\text{ d}t = -[e^{-\lambda t}]^{x}_{0}=1-e^{-\lambda x}\text{.}$$
(2) For $x \geq 0$, $\mathbb{P}(X > x) = e^{-\lambda x}$
Proof. $$\mathbb{P}(X > x) = 1 - \mathbb{P}(X \leq x) = 1 - (1-e^{-\lambda x}) = e^{-\lambda x}\text{.}\tag{*}$$
Also, don't forget that 
$$\mathbb{P}(X > x) = 1 - \mathbb{P}(X \leq x) = \int_{0}^{\infty}\lambda e^{-\lambda t}\text{ d}t-\int_{0}^{x}\lambda e^{-\lambda t}\text{ d}t=\int_{x}^{\infty}\lambda e^{-\lambda t}\text{ d}t\tag{**}$$
which must equal $e^{-\lambda x}$ by (*).
(3) It follows from the above that since
$$\int_{0}^{x}\lambda e^{-\lambda t}\text{ d}t = \lambda \int_{0}^{x}e^{-\lambda t}\text{ d}t = 1 - e^{-\lambda x}$$
that
$$\int_{0}^{x}e^{-\lambda t} \text{ d}t = \dfrac{1-e^{-\lambda x}}{\lambda}\text{.}\tag{***}$$

Thus, we have from (***) that
$$\begin{align}
\int_{0}^{\chi P_c^{-1}\|x_i\|^{\alpha}}e^{-sP_cg_i\|x_i\|^{-\alpha}}e^{-g_i}\text{ d}g_i &= \int_{0}^{\chi P_c^{-1}\|x_i\|^{\alpha}}e^{-[sP_cg_i\|x_i\|^{-\alpha}+g_i]}\text{ d}g_i \\
&= \int_{0}^{\chi P_c^{-1}\|x_i\|^{\alpha}}e^{-g_i[sP_c\|x_i\|^{-\alpha}+1]}\text{ d}g_i \\
&= \dfrac{1-e^{-[sP_c\|x_i\|^{-\alpha}+1][\chi P_c^{-1}\|x_i\|^{\alpha}]}}{sP_c\|x_i\|^{-\alpha}+1} \\
&= \dfrac{1-e^{-[s\chi P_c^{-1}P_c\|x_i\|^{-\alpha}\|x_i\|^{\alpha}+\chi P_c^{-1}\|x_i\|^{\alpha}]}}{sP_c\|x_i\|^{-\alpha}+1} \\
&= \dfrac{1-e^{-[s\chi +\chi P_c^{-1}\|x_i\|^{\alpha}]}}{sP_c\|x_i\|^{-\alpha}+1}
\end{align}$$
Furthermore, from (*) and (**), we have
$$\int_{\chi P_c^{-1}\|x_i\|^{\alpha}}^{\infty}e^{-g_i}\text{ d}g_i = e^{-(1)[\chi P_c^{-1}\|x_i\|^{\alpha}]} = e^{-\chi P_c^{-1}\|x_i\|^{\alpha}}\text{.}$$
Note that this integral is based on $\lambda = 1$.
A: Collecting the exponents we can rewrite the integral in the first line to get $\int^{\chi P^{-1}_c ||x_i ||^\alpha}_0 e^{-(sP_c||x_i||^{-\alpha}+1)g_i}dg_i +\int^\infty _{\chi P^{-1}_c ||x_i ||^\alpha} e^{-g_i} dg_i$ now, as you will know $\int^a _b e^{cx} dx = \frac{e^{ca} -e^{cb}}{c}$, and applying this to your integrals and using $e^0 =1$ and $\lim_{x\to\infty} e^{-x}/x = 0$  we get $ -\frac{e^{-sP_c||x_i||^{-\alpha}+1)\chi P^{-1}_c ||x_i ||^\alpha}-1}{sP_c||x_i||^{-\alpha}+1} + {e^{-{\chi P^{-1}_c ||x_i ||^\alpha}}}$ multiplying out the exponent in the first term we get $ -\frac{e^{-(s\chi+\chi P^{-1}_c ||x_i ||^\alpha)}-1}{sP_c||x_i||^{-\alpha}+1} + {e^{-{\chi P^{-1}_c ||x_i ||^\alpha}}}$  which you can clearly see is equal to $ \frac{1-e^{-(s\chi+\chi P^{-1}_c ||x_i ||^\alpha})}{sP_c||x_i||^{-\alpha}+1} + {e^{-{\chi P^{-1}_c ||x_i ||^\alpha}}}$ and we're done.
edit: I've just seen Clarinetist's answer and it's probably a bit clearer than mine.
