The continuous random variable $X$ has p.d.f. $$f(x) =\begin{cases} \frac{2(7-x)}{25},&\text{for $2\leq x\leq 7$}\\ 0,& \text{otherwise} \end{cases} $$
The function $g(X)$ is defined by $g(x) = x^2 + x$
Find the value of $E[g(X)]$.
Is the correct answer to this question $37/2$ or $397/6$? I disagree with the answer the textbook has given.
I believe the answer to be $37/2$, this is for 2 main reasons: Firstly, if you compute the integral of $(x^2 + x) (14/25 - 2x/25)$ with limits $2$ and $7$ then you get $37/2$. Secondly, an easier way. $E[X]$ in this case is $11/3$, and $E[X^2]$ is $89/6$ add them together: $89/6 + 11/3 = 37/2$. However, the textbook says the answer is $397/6$, and then follows up the question using this value.
In addition to your calculations, which appear to be correct:
With probability $1$ we have that $2 < x \leq 7.$ Within the interval $2 < x \leq 7,$ the function $g(x) = x^2 + x$ has its maximum at $x = 7.$ With probability $1,$ therefore, $g(x) \leq g(7) = 56.$ This implies that $E[g(x)] \leq 56.$
Observing that $\frac{397}{6} > 66,$ we know that $E[g(x)] \neq \frac{397}{6}.$