One formula computes the mean $E(X)$ and the other the $Var(X) = E(X^2)$. That is, the formulae being integrated are different, so you should expect the evaluation of the integrals to be different.
$\displaystyle E(X) = \int_1^3 x(1-x)(x-3) dx = \int_1^3 x(3 + 4x - x^2) dx = \int_1^3 (3x + 4x^2 -x^3) dx$
$\displaystyle Var(X) = \int_1^3 x^2(1-x)(x - 3) dx = \int_1^3 (3x^2 + 4x^3 - x^4) dx.$
Notice that in the first case, we are integrating a third-degree polynomial, and in the second case, we are integrating a fourth-degree polynomial.
Recall: For all nonnegative integers $n$ ,$ \int_a^b x^n \, dx = \left[\frac{1}{n+1}x^{n+1}\right]_a^b= \frac{1}{n+1}b^{n+1} - \frac{1}{n+1}a^{n+1}$
If you need more help with how to integrate polynomials, the link will take you to PlanetMath, where you'll find a tutorial to refresh your memory.
For a video tutorial: see Khan Academy's video, which discusses integration of polynomials. The Khan Academy's website also provides interactive tutorials so you can practice with actual problems, and brush-up on your math skills (here's a link to help you review Calculus, e.g.).