I have a random variable $X$ that has a pdf up to a proportionality defined by: $$f(x) \propto e^\frac{-(x-1)^2}{ 2}+e^\frac{-(x-4)^2}{2} \quad 0<x<5$$
Also is given that the $E(X)=2.5$.It seems like there are two normal distributions there but how can I find the constant $c$ in order to calculate the expected value.
The PDF $f(x) = c\left(e^{-(x-1)^2 / 2} + e^{-(x-4)^2 / 2} \right) \mathbf{1}_{(0, 5)}(x)$ is symmetric on $(0,5)$, meaning that $X$ has the same distribution as $-X+5$. To verify this, check that $f(x) = f(-x+5)$.
Knowing this, we can deduce $E[X] = E[-X+5]$ which gives $E[X]=2.5$ without needing to compute $c$. As far as I can tell, there is no simple expression for $c$ that avoids using the error function.