# Integrating (x+1)/x

A textbook way to integrate $$\frac{a}{x}$$ is $$\int \frac{a}{x} dx = a\ln(x)$$

However the answer to the question $$\int \frac{x+1}{x} dx$$

is not $$(x+1)\ln(x)$$

but is rather $$\frac{x}{x} + \frac{1}{x} = 1 + ln(x)$$

I see the logic of the latter answer but I don't understand why the former is wrong.

• Your doubt seems to come from the fact that you apparently think that $$\int\frac{x+1}xdx=(x+1)\int\frac{dx}x=(x+1)\log x$$ which is completely wrong, of course. – DonAntonio May 19 at 16:35
• $a$ is a constant, not a function of $x$. You can't treat a function of $x$, such as $x+1$, or anything involving $x$, as a constant. – KM101 May 19 at 16:38
• Also, the answer is $x+\ln\vert x\vert+C$, not $1+\ln(x)$. – KM101 May 19 at 16:43
The former is wrong because your way of integrating $$a/x$$ works (in general) only if $$a$$ does not depend on $$x$$. Since $$x+1$$ does depend on $$x$$, you can not use this rule.
An analogy: For a constant $$a$$, we have $$\int a\, \mathrm dx = a x + C$$. However, we don’t have $$\int \dfrac1x\, \mathrm dx = 1 + C$$.