Okay, here is what we will do. Note that the probability f(x) is already shown in the question. The expected value is also known as the mathematician's term for the mean is just
.
Next step we are told
and next, we will have
because we multiplied the x from the integral.
We should have this
The rest is just taking candy from a baby.
Usually, these questions can be done like this the integral is basically the sum of all the sections involved in the graph and there to find the expected value you just need to multiply by x because by doing so you will have the case where each possibility is multiplied by the individual event and this can be found from the trapezoidal rule.