You have mishandled the limits of integration when making the substitution in the integral. If then when and when . So the integral should become

You have worked out the integral correctly (apart from having instead of as the upper limit of integration), and it leads to the result , which is what you want.