Suppose we have the following PDF of X:
$f(x)=\frac{1}{4}(2-x)\;;-1\leq x\leq 1$
We want to use $g(x)\sim\mathrm{Unif}(-1,1)$ as a proposal density to generate samples from $f(x)$ using a rejection sampling.
Our usual approach will be, to find $M$ such that
$M=Sup_{x\in [-1,1]}\frac{f(x)}{g(x)}$
But we can not calculate it by differentiating $\Phi=\frac{f(x)}{g(x)}$ with respect to $x$ and equating it to 0.
Are there any other possible ways to find the upper bound?