If $f(x)=x-1$, I want to find $$ \int (x-1) \ dx $$. I make a variable substitution z = x-1, dx = dz so it becomes $$ \int z \ dz \\ = \frac{z^2}{2} + C $$. If I now substitute back $z=x-1,$ I get: $$ \int x-1 \ dx = \frac{(x-1)^2}{2} + C $$
Now if I do it another way without variable substitution I get: $$ \int x \ dx - \int 1 \ dx = \frac{x^2}{2} - x + C$$
What is going on here since these answers seem different to me? Are they both right but the constans $C$ are different or what am I missing here?