To answer your second question, the reason it turns into is because when you are integrating using the reverse power rule which says
however this only works if , because then denominator becomes 0. In your case, we have , so so it doesn't work. So we use . Make sure that it's absolute value of x and not just regular x. If you don't put the absolute value signs, you'll get it wrong.