Integrating $\int x+1 \, dx$ using $u$-substition gives wrong answer. $\int (x+1) dx$
Substituting:
$u = x + 1$ and $du = dx$
$$\int u \,du = \frac{u^2}{2}$$
Which gives:
$$\int (x+1) \, dx = \frac{(x+1)^2}{2}$$
This is completely wrong as the correct answer is $\frac{x^2}{2}+x$
Why did this happen?

You forgot the constant C. It is very important:
$$
\int u du = \frac{u^2}{2} + C = \frac{(x+1)^2}{2} + C = \frac{x^2}{2} + x + \frac{1}{2}+ C = \frac{x^2}{2} + x + C'
$$
