We have $$f\left(x\right)=0.8\left(\frac{1}{5\sqrt{2\pi}}e^{-\frac{1}{50}\left(x-50\right)^2}\right)+0.2\left(\frac{1}{8\sqrt{2\pi}}e^{-\frac{1}{128}\left(x-60\right)^2}\right)$$
This can be written in a more nicer way:
$$g\left(x\right)=0.8\left(\frac{1}{5\sqrt{2\pi}}e^{-\frac{1}{2}\left(\frac{x-50}{5}\right)^2}\right)+0.2\left(\frac{1}{8\sqrt{2\pi}}e^{-\frac{1}{2}\left(\frac{x-60}{8}\right)^2}\right)$$
To calculate the expectation, it is equal to $0.8(50) + 0.2(60)=52$, since we see that this is essentially $0.8N(\mu=50, \sigma^2=25)+0.2N(\mu=60, \sigma^2=64)$
We get confirmation from desmos:
What about variance though?
$var(0.8N(\mu=50, \sigma^2=25)+0.2N(\mu=60, \sigma^2=64)=0.8^2(25)+0.2^2(64)=18.56$
But also, $v(x)=E(x^2)-(E(x))^2$
Verifying the above on desmos, I get a different answer:
About $48.8$, so I am not sure where I went wrong. I know the integral is entered correctly on desmos, but where have I gone wrong with the variance?


for a function of the form
$$ f(x) = a \frac{1}{\sqrt{2\pi \sigma_1^2}}e^{(x - \mu_1)^2/2\sigma_1^2} + (1- a)\frac{1}{\sqrt{2\pi \sigma_2^2}}e^{(x - \mu_2)^2/2\sigma_2^2} $$
you have
$$ \int_{-\infty}^{+\infty} {\rm d}x~ f(x) = a + (1 - a) = 1 $$
$$ \int_{-\infty}^{+\infty} {\rm d}x~ x f(x) = a\mu_1 + (1 - a)\mu_2 \tag{1} $$
and
$$ \int_{-\infty}^{+\infty} {\rm d}x~ x^2 f(x) = a(\mu_1^2 + \sigma_1^2) + (1 - a)(\mu_2^2 + \sigma_2^2) \tag{2} $$
So that
$$ \mathbb{V}{\rm ar}[X] = \int_{-\infty}^{+\infty} {\rm d}x~ x^2 f(x) - \left( \int_{-\infty}^{+\infty} {\rm d}x~ x f(x) \right)^2 = a(\sigma_1 - \sigma_2)(\sigma_1 + \sigma_2) + \sigma_2^2 + a(1 - a)(\mu_1 - \mu_2)^2 \tag{3} $$