Solution (source code)

= Solution

Write $Z=\int_a^\infty x^{\alpha-1}e^{-\beta x}\,dx$. A proper target requires $\beta>0$, and a proper proposal requires $b>0$. Normalization gives $f(x)=x^{\alpha-1}e^{-\beta x}/Z$ and the <Pareto distribution> proposal $g(x)=ba^b x^{-b-1}$ on $x>a$. Their ratio is
$$
\frac{f(x)}{g(x)}=\frac{x^{\alpha+b}e^{-\beta x}}{ba^bZ}.
$$
The derivative of its logarithm is $(\alpha+b)/x-\beta$. It is positive before $x_*=(\alpha+b)/\beta$ and negative after it. Since $a<\alpha/\beta<x_*$, the maximum occurs within the proposal support. Consequently the tight envelope for <truncated gamma rejection sampling with a Pareto envelope> is
$$
\boxed{M=\left(\frac{\alpha+b}{\beta}\right)^{\alpha+b}e^{-(\alpha+b)}\left(ba^b\int_a^\infty x^{\alpha-1}e^{-\beta x}\,dx\right)^{-1}.}
$$
The accompanying acceptance rule can be evaluated without $Z$:
$$
\frac{f(x)}{Mg(x)}=\left(\frac{x}{x_*}\right)^{\alpha+b}\exp[-\beta(x-x_*)]\le1.
$$