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 } $$