Let $f(x) = 0.025x + 0.15$ for $2 < x < 6$.
The expected value formula is $1/2 \cdot (b-a)$. So is the expected value just $1/2 \cdot (6-2) = 4$ or do I have to integrate $f(x)$ first?
Let $f(x) = 0.025x + 0.15$ for $2 < x < 6$.
The expected value formula is $1/2 \cdot (b-a)$. So is the expected value just $1/2 \cdot (6-2) = 4$ or do I have to integrate $f(x)$ first?
Your distribution is not uniform in $[2,6]$, so the formula $\frac12(b+a)$ does not hold. Instead, calculate the expected value of $X$ by the general formula as follows $$E[X]=\int_{\mathbb R} xf(x)dx=\int_{2}^6x(0.025x+0.15)dx=4.1\overline{3}$$ The pdf of a uniform random variable on $[2,6]$ would be $$f(x)=\frac{1}{6-2}=\frac14$$ for $2\le x\le 6$ and $f(x)=0$ otherwise.