You can't just slip a non-constant outside the integral.