Integration by parts or substitution for $\int x \cos (x^2) dx$ With $$\int x \cos (x^2) dx$$ I can use substitution to solve this integral.
$$u=x^2, dx =\frac{du}{2x}$$
$$\int x \cos (x^2) dx = \int x \cos (x^2) \frac{du}{2x} = \frac{1}{2} \int \cos(u) = \frac{1}{2}\sin(u)=\frac{1}{2}sin(x^2)+C$$
But can't I also solve it with integration by parts and should get the same result?
$$\begin{array} \int x\cos (x^2) dx &= \frac{1}{2}x\sin(x^2) - \frac{1}{2}\int 1\sin(x^2)dx
\\
&= \frac{1}{2}x\sin(x^2) + \frac{1}{4}\cos(x^2)+C
\end{array}$$
Or am I mixing up things?

$$\int \sin(x^2)\,dx \neq -\frac{1}{2}\cos(x^2)+C$$
$$\int \cos(x^2)\,dx \neq \frac{1}{2}\sin(x^2)+C$$
You can confirm that by differentiating the RHS.
