$\ X \sim U (-4,7) $ with $U$ a continuous uniform distribution.
X is continuous variable. Compute $\ E[|X^2 - 16|] $
So: $$\ E[|X^2 - 16|] = \begin{cases} E[X^2 - 16] , \ \ 4< X \\ E[-X^2+16], \ \ X < 4 \end{cases} \\ $$ My attempt is to calculate each case and then sum them. $$E[X^2 - 16] = \sum_{i=4}^7 (X_i^2-16) \cdot \frac{1}{11} = \frac{1}{11} \cdot \sum_{j=1}^4 (j+3)^2-16 = \frac{1}{11} \cdot \sum_{j=1}^4 j^2 +6j - 7\\ = -\frac{28}{11}\cdot (\sum_{j=1}^4 j^2 + 6\cdot\sum_{j=1}^4 j) = - \frac{28}{11} ( \frac{4 \cdot 5 \cdot 9}{6} \ + 6 \cdot \frac{4 \cdot 5}{2} )$$
But I'm not sure if that's the correct way to compute?
$X$ is a random variable and not a constant. You cannot split the computation into the cases $4<X$ and $X<4$. (The probabilities of these events will have an effect on the answer). Also, you treating a continuous random variable as a discrete one. The finite sums you are considering are not related to uniform distribution at all. The correct formula for $E|X^{2}-16|$ is $\frac 1 {11} \int_{-4}^{7} |x^{2}-16|\, dx$. Now split the integral into integral form $-4$ to $4$ and $4$ to $7$.