Supposing we want to take a sample from the distribution $p(x)=cp^*(x)$ where $c$ is the normalization constant and $p^*(x)$ is given by
$p^*(x)=0.5\exp(-(x-\mu_1)^2)+0.5\exp(-(x-\mu_2)^2).$
Construct a rejection algorithm, that uses a function from a normal distribution with mean $μ$ and variance $σ^2$. Identify the μ and σ, for given values of $μ_1$ and $μ_2$. Check your results comparing them with a more simple algorithm that takes a sample from $p(x)$ using the method of synthesis.
What I have done so far
-Supposing $g=N(\mu,\sigma^2)$ . -I have found the $\frac{p^*(x)}{g(x)}$.
-Then I found the derivative and calculate $\frac d{dx}\frac{p^*(x)}{g(x)}=0$ in order to found the $x$ that verifies my equation. But here is my basic problem: if my calculations are right I find two solutions $x_1$ and $x_2$. I don't know how I should proceed then, in order to find the $M$ (the upper bound of $\frac{p^*(x)}{g(x)}$, because i have two $x$... should i use both of them?
-I have found also, $\mu=\sigma^2(\mu_1+\mu_2)$.
I would appreciate any help/tip.