Failing a basic integration exercise; where did I go wrong?

$v'=\sin\sqrt{x}\ $ does not imply $\ v=-\cos\sqrt{x}$.

By the chain rule, $\frac{d}{dx}(-\cos(x^\frac{1}{2})) = \frac12x^{-\frac12} \times \sin\left(x^\frac12\right) \neq \sin\sqrt{x}$.

In fact, to find $v$, which equals $\int \sin\sqrt{x}\ dx$, you have to use a substitution like $u^2 = x.$ Then by integrating by parts, you should get that $v = 2\sin(\sqrt{x}) - 2\sqrt{x}\cos(\sqrt{x}).$

You can continue down this path, but it is a bit ugly, so let's see if there's a simpler overall approach. The original integral is $\int \sqrt{x}\cdot\sin\sqrt{x}\,dx$. It's best to just start with the substitution $u=\sqrt{x}\quad (^*)$.

Then the integral becomes $2\int u^2 \sin(u) du$, which is much nicer to work with. I think you solve this by integrating by parts twice.

$(^*)$ I originally used the substitution $\ x = u^2\ $ but I think this is inaccurate because $\sqrt{u^2} = |u|,\ $ so the integral would actually become $\ 2 \large{\int}$ $u\ |u| \sin(|u|)\ du,\ $ which I'm not sure is correct. Basically the substitution $\ x = u^2\ $ doesn't tell us if $u=\sqrt{x}\ $ or $\ u=-\sqrt{x}.\ $ Using the substitution $\ u=\sqrt{x}\ $ leaves no room for ambiguity.


The mistake is $$v'=\sin\sqrt{x}\,dx \to v=\int \sin\sqrt{x}\,dx\neq -\cos\sqrt{x}+k, \quad k\in \Bbb R$$

$$\int \sin\sqrt{x}\,dx=2\left(-\sqrt{x}\cos \left(\sqrt{x}\right)+\sin \left(\sqrt{x}\right)\right)+k',\quad k'\in \Bbb R$$

Tags:

Integration