TITLE: Calculating $\int x dx$ using trigonometric functions
QUESTION [11 upvotes]: Well, I tried to solve the integral: $$\int x dx$$ using trigonometric functions instead of using the general formula for it. (If $n \neq -1$,$\int x^n dx=\frac{x^{n+1}}{n+1}+C$)
So I gave it shot in this way:
$$\int x dx = \int \sin\theta \cos\theta d\theta = \dfrac{1}{2}\int \sin2\theta d\theta=\dfrac{1}{2}\big(\dfrac{-1}{2}\cos^2\theta\big)+C=\dfrac{-1}{4}(\cos^2\theta-\sin^2\theta)+C$$
$$x=\sin\theta ,\cos\theta=\sqrt {1-x^2}, dx = \cos\theta d\theta$$
Thus we substitute them:
$$\int x dx = \dfrac{1}{2}\int \sin2\theta d\theta=\dfrac{-1}{4}(\cos^2\theta-\sin^2\theta)+C=\dfrac{-1}{4}+\dfrac{x^2}{2}+C'$$
If I had solved the integral with the general formula I wouldn't have got partial amount of the integration constant($\dfrac{-1}{4}+C'$) as my final answer.
Simply, my question is why another constant would rise up when I do the integration with trigonometric substitution?I know that I can disregard the appeared constant but why does it even rise up?
If I'm still not clear enough, please tell me to correct my question.

REPLY [6 votes]: The constant of integration is arbitrary and two anti-derivatives are equivalent if they differ by a constant.
For example, since
$$
\int0\,\mathrm{d}x=C
$$
we get not only
$$
\int\cos(x)\,\mathrm{d}x=\sin(x)+C
$$
but also
$$
\begin{align}
\int\cos(x)\,\mathrm{d}x
&=\int(\color{#C00000}{\cos(x)}+\color{#00A000}{0})\,\mathrm{d}x\\
&=\int\color{#C00000}{\cos(x)}\,\mathrm{d}x+\int\color{#00A000}{0}\,\mathrm{d}x\\[6pt]
&=\color{#C00000}{\sin(x)+C}+\color{#00A000}{C}
\end{align}
$$
where the constants $\color{#C00000}{C}$ and $\color{#00A000}{C}$ are possibly different constants.

In the particular case you give, using $x=\sin(\theta)$,
$$
\begin{align}
\int x\,\mathrm{d}x
&=\int\sin(\theta)\,\cos(\theta)\,\mathrm{d}\theta\\
&=\int\tfrac12\sin(2\theta)\,\mathrm{d}\theta\\
&=-\tfrac14\cos(2\theta)+C\tag{$\ast$}\\[3pt]
&=-\tfrac14(1-2\sin^2(\theta))+C\\[3pt]
&=\tfrac12\sin^2(\theta)+C-\tfrac14\\[3pt]
&=\tfrac12x^2+C-\tfrac14
\end{align}
$$
In step $(\ast)$, note that although $x=0$ corresponds to $\theta=0$, $-\frac14\cos(2\theta)=-\frac14$ at $\theta=0$. This is where the $-\frac14$ is introduced, if that is what you are asking about.
However, even simpler alterations to the method of integration can yield different, but equivalent, forms of the constant of integration:
$$
\begin{align}
\int x\,\mathrm{d}x
&=\frac12\int 2x\,\mathrm{d}x\\
&=\frac12\left(x^2+C\right)\\[6pt]
&=\tfrac12x^2+\tfrac12C
\end{align}
$$