1

Wolfram Alpha gave me a solution to an integration that needs consecutive substitution, where I do not understand how to make a definite decision on which function should be u and which du.

$$\int x \sin(x^2) \cos(x^2) dx$$

My approach was to expand the equation by 2/2 and set $u = x^2$:

$$ \frac{1}{2} \int du \; \sin(u) \; \cos(u)$$

And then make $\sin(u) = v$

$$ \frac{1}{2} \int v dv$$

Thus getting: $$ \frac{1}{4} \cos^2(x^2) $$

But Wolfram Alpha gave me

$$-\frac{1}{4} \sin^2(x^2)$$

which must be because it used $v=\cos(u)$ instead. But the solutions are different. Can someone please explain why this has to be that way as in WA, or are both ways possible? And if there are two possible solutions, what does that mean for the interpretation of the integral?

Gary
  • 36,640
lemma25
  • 11
  • 2

1 Answers1

1

Pythagoras in disguise:

$$-\sin^2(y) = \cos^2(y) + 1 $$

Now substitute $x^2$ for $y$ and multiply everything by $\frac{1}{4}$ and you get:

$$ -\frac{1}{4} \sin^2(x^2) = \frac{1}{4} \cos^2(x^2) + \frac{1}{4}$$

So the both solutions differ just by a constant (of $\frac{1}{4}$), which is fine for an integral. Both solutions are correct.

Kaligule
  • 1,582
  • 10
  • 12