Math Help - Mean and Variance of Continous distribution

1. Mean and Variance of Continous distribution

A continuous probability density distribution for the random
variable
X has the form:

f(
x) = ke^x if 0 < x <2 (the < should be equal to or less than)
=
ke^(4-x) if 2 < x < 4
= 0 otherwise

Use integration to determine:

the value of k
(i) the mean of the distribution,
(ii) the variance of the distribution.

Your help would be very much appreciated

2. Hi

Then mean is given by $\mu=\int_{\mathbb{R}}xf(x)\,\mathrm{d}x$

Splitting the integral gives : $
\mu=\int_{-\infty}^0xf(x)\,\mathrm{d}x+\int_0^2xf(x)\,\mathrm {d}x
+\int_2^4xf(x)\,\mathrm{d}x
+\int_4^{\infty}xf(x)\,\mathrm{d}x$
and as you know $f$ on each interval, you can go on .

Concerning the variance, it is defined by $V=\int_{\mathbb{R}}x^2f(x)\,\mathrm{d}x-\mu^2$.

Again, split the integral into four parts and it will give you the result.

note : in both cases, integration by parts might be helpful.

Hope that helps.

3. $\mu = \int_{0}^{2} xke^{x}\ dx + \int_{2}^{4} xke^{4-x} \ dx$.

Then $\text{Var}(X) = (E[X])^{2} - \mu^{2}$

4. Originally Posted by tukeywilliams
$\mu = \int_{0}^{2} xke^{x}\ dx + \int_{2}^{4} xke^{4-x} \ dx$.

Then $\text{Var}(X) = {\color{red}E[X^{2}]} - \mu^{2}$
I've corrected (in red) a small typo.