$\int \frac{x}{x+1}\,dx$ can't find mistake in a step

$\int \frac{x}{x+1}\,dx$ so I set substitution to $x+1=t$ then I differentiate to get $dx=dt$ and then proceed to get $\int 1\,dt - \int \frac{1\,dt}{t}$ to get $t-\ln(|t|)+C$ but when I replace back the substitution I get $x+1$ in the final answer instead of just the $x$ , so my question is why was it a mistake to integrate $\int 1\,dt$ instead to switch back to x and then integrate $\int 1\,dx$

• It is easier to write $\frac{x}{x+1}=1-\frac{1}{x+1}$ in this case, there is no substitution needed. – rae306 Oct 25 '17 at 16:51
• @ubacimKuP You have a nice nick name – Aqua Oct 25 '17 at 16:54
• I immediately spotted this substitution so I didnt look farther , thank you – ubacimKuP Oct 25 '17 at 16:56

There is nothing wrong in your solution .

$x+1-\ln|x+1| + C$

Now let $C+1=C'$

$x-\ln|x+1|+C'$

You can always adjust the constant of integration.

• Quick yes or no question , shifting constants like that wont have an effect on the solution even if for example there was $\int f(x) dx -4$ as long as it doesnt affect the variable? – ubacimKuP Oct 25 '17 at 17:07
• @ubacimKuP Yes, there won't be any affect of shifting constants. For example - If your answer to any integration is $\ln(2x)+C$ and the answer given is $\ln(x)+k$, both are correct, since both the answers differ by some constant only. I hope you understand now. – Jaideep Khare Oct 25 '17 at 17:21

Alternative:

$\int \frac{x}{x+1}\, dx=\int \frac{x+1-1}{x+1}\, dx=\int 1-\frac{1}{x+1}\, dx= x-\ln|x+1|+C$

Without substitution.