Integration by parts I understand, but part of the problems for this section has instructions to "First make a substitution and then use integration by parts to evaluate the integral". The book itself doesn't even mention this in the section. I have the answers, but it's not really helping me understand what's going on or why.

example:

$\displaystyle \int{cos\sqrt{x}dx}$

The answer says to substitute for $\displaystyle \sqrt{x}$, so

$\displaystyle u=x^\frac{1}{2}$.

Thus

$\displaystyle du=\frac{1}{2}x^\frac{-1}{2} = \frac{1}{2\sqrt{x}} = \frac{1}{2y}$

Switching in the y is a bit of a stretch. I understand it, but I'm not sure I understand why. The book then shows to substitute all this back into the original problem to get

$\displaystyle \int{cosy(2ydy)}$

I don't understand this at all... how'd we get from $\displaystyle dx = \frac{1}{2y}dy$ to $\displaystyle cosy(2ydy)$? From there, it's just integration by parts, and I understand the process. It's only the substitution part that's got me baffled.

If someone is able to explain the how and why of that, I'd be much appreciative.