Why does $\int\frac{1}{2x+1}dx=\frac{1}{2}\ln|2x+1|+C$? The way I am thinking is as follows:
$$\int\frac{1}{2x+1}\,dx = \int\frac{1}{2}\frac{1}{x+\frac{1}{2}}\,dx = \frac{1}{2}\int\frac{1}{x+\frac{1}{2}}\,dx = \frac{1}{2}\ln\left|x+\frac{1}{2}\right|+C$$
However, the textbook answer is $\frac{1}{2}\ln|2x+1|+C$. Where is my thinking wrong?
 A: You forgot to add a constant, $C$. This is important: your answer differs from the textbook's only by a constant. 
$$\frac{1}{2}\ln\left|x + \frac{1}{2}\right| = \frac{1}{2}\ln\left|\frac{2x + 1}{2}\right| = \frac{1}{2}[\ln|2x + 1| - \ln(2)] = \frac{1}{2}\ln|2x + 1| - \frac{1}{2}\ln(2)$$
So 
$$\int \frac{1}{2x+1}\, dx = \frac{1}{2}\ln\left|x + \frac{1}{2}\right| + C = \frac{1}{2}\ln|2x + 1| + C.$$
A: Firstly, is your answer even wrong? Remember that 
$ln(xy)=ln(x)+ln(y)$. So if $y$ is a constant and $x$ is the variable we get, when taking the derivative, that $f(x)=ln(xy)\Rightarrow f'(x)=\frac{1}{x}$. I recommend you check your answer by taking a derivative.
Furthermore I can inform you that your textbook answer is sloppy: $$\int \frac{1}{2x+1}dx$$ is an indefinite integral, or an antiderivative, which means that any answer should include an integration constant, e.g. the answer should be $\frac{1}{2}ln|2x+1|+C$, where $C$ is an arbitrary constant. If the authors of your textbook omitted this I'm not very impressed by their effort. 
A: Let us given
$$ \int{1\over2x+1}dx$$
Let us do the following substitution
$$ u = 2x+1 $$
So,
$$ du = 2dx $$
Finally,
$$ \int{1\over2x+1}dx = \frac12\int{1\over{u}}du = \frac12\ln\lvert{u}\rvert+C=\frac12\ln\lvert{2x+1}\rvert+C$$
