I am currently working through trigonometric integrals and working on this problem specifically:
$$ \int_{}^{} \sin ^{2}x\cdot\sin (2x) \, dx $$
And the way I approached this was to convert $\sin ^{2}x$ to $\frac{1}{2}(1-cos(2x)$ using that trigonometric identity and working through the problem as follows:
$$ \int_{}^{} \sin ^{2}x\cdot\sin (2x) \, dx \\ \\ $$ $$ =\int_{}^{} \frac{1}{2}\cdot(1-\cos(2x))\cdot \sin (2x) \, dx \\ \\ $$ $$ =\frac{1}{2}\int_{}^{} (1-\cos(2x))\cdot \sin (2x) \, dx \\ \\ $$ $$ =\frac{1}{2}\int_{}^{} \sin(2x)-\sin(2x)\cdot \cos(2x) \, dx \\ \\ $$ $$ =\frac{1}{2}\int_{}^{} \sin(2x) \, dx - \frac{1}{2}\int_{}^{} \sin(2x)\cdot \cos(2x) \, dx \\ $$ $$ \text{let u = sin(2x)} \\ $$ $$ \text{therefore du = 2cos(2x) dx} \\ \\ $$ $$ =\frac{1}{2}\int_{}^{} \sin(2x) \, dx -\frac{1}{2}\int_{}^{} \frac{1}{2}u \, du \\ \\ $$ $$ =-\frac{1}{4}\cos(2x) -\frac{1}{8}u^{2} \\ \\ $$ $$ =-\frac{1}{4}\cos(2x) - \frac{1}{8}\sin ^{2} (2x) + C $$
But the textbook's answer is:
$$\frac{1}{2}sin ^{4}(x) + C$$
and I guess the way they've approached the problem is by using the trigonometric identity $sin(2x) = 2sin(x)cos(x)$ and then u-subbing out sin(x) from the resulting:
$$ \int \sin ^{2}x(2\sin x\cos x) dx $$ and working through that (which admittedly is way more elegant/faster). But what I'm wondering is why my answer seems correct to me but is so different and even graphs differently than the textbook's answer?