# Getting 2 different solutions to the integral of $\frac{dx}{2x}$

I get two different answers that seem to conflict.

Is there an error in one method??

### Method 1

\begin{align} \int \frac{\mathrm{d}x}{2x}&=\frac 1 2 \int\frac{\mathrm{d}x}{x}\\ &=\frac 1 2\ln|x|+C \end{align}

### Method 2

\begin{align} \int \frac{\mathrm{d}x}{2x}&=\frac 1 2 \int \frac{2\mathrm{d}x}{2x}\\ &=\frac 1 2\int \frac{\mathrm{d}u}{u},\;\;\text{ where }u=2x,\ \mathrm{d}u=2\mathrm{d}x\\ &=\frac 1 2 \big(\ln |u| + C\big)\\ &=\frac 1 2 \ln|2x|+C \end{align}

• As the answer below details: the $C$'s are 'different', for want of a better word. Your "paradox" here is one of the reasons we are careful to always put a $C$ at the end, and also have to stay constantly aware of what it means. Oct 21, 2016 at 13:58
• Another good example is integrating $\sin(x)\cos(x)$. Try integration by parts, to get $\frac{1}{2}\sin^2(x)+C$, then try using the trig identity $\sin(x)\cos(x)=\frac{1}{2}\sin(2x)$ to get $-\frac{1}{4}\cos(2x)+D$. A hint on reconciling the answers is $\cos(2x)=1-2\sin^2(x)$. Oct 21, 2016 at 14:06
• When we get two ostensibly different solutions to an anti-differentiation problem, it is often helpful to check whether the solutions (ignoring the constants) are vertical translations of each other. If so, the two solutions must, of course, differ by a constant. In this case, $\frac 1 2\ln|x|$ translated vertically $\ln\sqrt{2}$ units yields $\frac 1 2\ln|2x|$. Oct 21, 2016 at 16:40

Hint: $\frac{1}{2}\ln{|2x|} + C = \frac{1}{2}\ln{|x|} + \frac{1}{2}\ln{2} + C = \frac{1}{2}\ln{|x|} + \left(\frac{1}{2}\ln{2} + C\right)$.