When you're putting substitutions on integral you're not subst. everything, you're working with both x and u. When you substitute something with u, you have to express everthing inside of integral with u.

In that case in a) after sub. the integral would be. Here substitute again

so the integral will be

The same mistake in part b).