We are told , so it can be treated like a constant.
Sure it's a constant, but hmmm how to explain it... Have a look at the indicator functions in my post above.
Or try to think about it this way :
You're defining an integral with respect to x. And then you're stating a condition "exterior" to the integral and involving x. That makes no sense at all...