Why can't I make the substitution $ u = \sin (ax + b) $ to evaluate $ \int \sin (ax + b) \cos (ax + b) dx$? Evaluate $ \int \sin (ax + b) \cos (ax + b) dx$?

To do this, I started of by substituting $ u = \sin (ax + b) $. That made $ du = cos (ax + b) \cdot a $ and wrote the integral as $ \frac 1a \int u \ du $ to get the final answer as: $$ \frac 1{2a} \sin^2 (ax + b) $$
This answer however, is wrong. My textbook uses a different method and arrives at a different answer. I understand how to arrive at the (right) answer but I want to know why I can't get the same answer by substitution here. 

My textbook starts off by rewriting the expression as $ \frac {\sin 2 (ax + b)}{2} $ and then substitutes $ 2 (ax + b) = u $ to get this answer: $$ - \frac { \cos 2 (ax + b) } {4a } $$
Note that $$1-\cos2(ax+b)=2\sin^2(ax+b)$$

So the textbook gives almost the same as your outcome and the difference is constant.

That is allowed because to be found is an antiderivative (not an integral).
You can solve with the substitution
u=sin(ax+b) then, 
du=acos(ax+b)dx so,
∫sin(ax+b)cos(ax+b)dx=∫(u/a)du=(u^2)/(2a)=sin^2(ax+b)/(2a)
which is same with your answer-1/4a