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!