Variance of a single random variable with two terms. A random variable X, representing the time until some event occurs, has the following pdf.
$$(14/99)e^{-0.5x}+(85/99)e^{-0.25x}$$.
Using integration, I get the expectation as 14.303 via $\int_0^\infty xf(x)dx$, and a variance of 463.453 via $\int_0^\infty (x-\overline{x})^2f(x)dx$.

*

*I don't understand why the variance is so high. I also computed the median, which was much higher than the mean.

When I try and compute the variance using $Var(X)=E(X^2)-(E(X))^2$ I get a negative value.
2) Why is there a mismatch between using these 2 methods?
 A: As noted your density is not exactly a pdf. Anyway it is clearly a mixture of 2 different negative exp pdf
$$f_X(x)=a f_1(x)+(1-a)f_2(x)$$
and obviously
$$f_1(x)=0.5e^{-0.5 x}$$
and
$$f_2(x)=0.25 e^{-0.25x}$$

In this case,
$$\mathbb{V}[X]=\mathbb{E}[X^2]-\mathbb{E}^2[X]$$
$$\mathbb{E}[X^2]=\frac{14}{99}\int_0^{+\infty}\frac{1}{2}x^2e^{-x/2}dx+\frac{85}{99}\int_0^{+\infty}\frac{1}{4}x^2e^{-x/4}dx=$$
$$=\frac{14}{99}\cdot 4\int_0^{+\infty}\Bigg(\frac{x}{2}\Bigg)^2e^{-x/2}d\Bigg(\frac{x}{2}\Bigg)+\frac{85}{99}\cdot 16\int_0^{+\infty}\Bigg(\frac{x}{4}\Bigg)^2e^{-x/4}d\Bigg(\frac{x}{4}\Bigg)=$$
$$=\frac{14}{99}\cdot 4\cdot \Gamma(3)+\frac{85}{99}\cdot 16\cdot \Gamma(3)=\frac{14}{99}\cdot 4\cdot 2+\frac{85}{99}\cdot 16\cdot 2$$
... in the same way you can easy calculate $E(X)$ and finally the variance

Edit
The variance will result:
$$V[X]=\Bigg(\frac{14}{99}\cdot 8+\frac{85}{99}\cdot 32\Bigg)-\Bigg(\frac{14}{99}\cdot 2+\frac{85}{99}\cdot 4\Bigg)^2\approx 14.79$$
A: The problem is that the pdf is not properly normalized, i.e.
\begin{align}
\int_0^\infty f(x) dx &= \frac{14}{85}\int_0^\infty e^{-x/2} \ dx + \frac{85}{99}\int_0^\infty e^{-x/4} \ dx \\
&= 2\frac{14}{85} + 4\frac{85}{99} \\
& \neq 1
\end{align}
I would make sure you have the correct pdf. Perhaps there should be a coefficient of 1/2 on the first term, and 1/4 on the second term?
