x is not constant -- you can't take it outside the integral.