2

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?

Chris
  • 521

2 Answers2

5

The problem in your integration by parts is that $$\int \cos(x^2) \,dx \neq \frac 12\sin(x^2)$$

And similarly, you cannot integrate $\sin(x^2)$ as you did.

In both case, you are implicitly treating $x^2$ as the variable of integration, i.e., you are implicitly treating it as you would treat $u = x^2$ and integrating with respect to $u$, except for the fact that your failed to accommodate $du = 2x \,dx \iff dx = \dfrac{du}{2x}\neq \dfrac{du}2.$

amWhy
  • 209,954
4

$$\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.

Pranav Arora
  • 11,014