That's not the proper substitution.
If you put then You actually have the and the is replaced by Do the substitutions.
Just in case a picture helps...
You have to choose it a particular way round in order to work backwards through the chain-rule for differentiation.
You're trying to work out how the given expression might have resulted from differentiating according to this rule, so that it fits the pattern
or, in other words, fits into the bottom level of the picture. Then we can integrate up the straight dashed line with respect to the dashed balloon expression. Imagine the dashed balloon is empty, or indeed is just a variable, and you should be able to find the function F...
Don't integrate - balloontegrate!
Balloon Calculus: worked examples from past papers