What is wrong with my proof that $\int 2x dx= 2x^2$ by writing $2x=\underbrace{2+2+\cdots+2}_{x\;\text{times}}$? I know $\int 2x \,dx = x^2 + C$ (by the power rule) but why does the following proof not give the same answer?
\begin{align*}
\int 2x \,dx &= \int \underbrace{(2 + 2 + 2 + \dots + 2)}_{x \text{ times}} \, dx \\
             &= \underbrace{\int{2} \, dx + \int{2} \, dx + \dots \ + \int{2}_ \, dx}_{x \text{ times}}\\
             &= 2x + 2x + \dots + 2x + C \\
&= 2x \times x + C \\
&= 2x^2 + C
\end{align*}
(And I have the same question for this false proof that $\int{2^x} \, dx = 2^{x}x+ C$)
\begin{align*}
\int{2^x} \,dx &= \int \underbrace{(2 \cdot 2 \cdot 2 \cdot \dots \cdot 2)}_{x \text{ times}} \cdot 1 \, dx \\
             &= 2 \cdot \int \underbrace{(2 \cdot 2 \cdot 2 \cdot \dots \cdot 2)}_{(x-1) \text{ times}} \cdot 1 \, dx && (\text{Constant Multipule Rule})\\
             &= 2^2 \cdot \int \underbrace{(2 \cdot 2 \cdot 2 \cdot \dots \cdot 2)}_{(x-2) \text{ times}} \cdot 1 \, dx && (\text{Constant Multipule Rule})\\
             &= 2^x \cdot \int{1} \, dx \\
&= 2^{x}x+ C \\
\end{align*}
I suspect that it has something to do with not being able to:

*

*Change integral of sums to sums of integrals for an arbitrary $x$, and


*Remove a constant out of an integral if there are variable numbers of those constants.
But I'm not sure why these do not hold. If this is the reason, is there a theorem stating it?
Thanks in advance!

An integral might run from $x=0$ to $x=X$.
In $\int2xdx$, the function is increasing as you go along.  So the first $2$ is there all the way as x goes from 1 to X, but the second $2$ doesn't start until x is 2, and the final $2$ doesn't appear until x has already reached X.
In $\int2dx+\int2dx+...$, all the $2$s are there all the way as x goes from 0 to X.
