# A question on integration of $x-a$

I am faced with the following integral:

$$\int(x-a) dx$$

I can think of two approaches to solve it:

1) Separating into two terms as follows:

$$\int x dx -a\int 1 dx$$

From which the result would be:

$$\int (x-a) dx = x^2/2 - ax$$

2) Substituting $$u =x-a$$; $$du=dx$$

$$\int u du = u^2 / 2 = (x - a)^2 / 2$$

If we expand this solution:

$$\int (x-a) dx = x^2/2 -ax + a^2/2$$

Now, clearly, $$x^2/2 -ax+a^2/2$$ is not equal to $$x^2/2 - ax$$. So is either method invalid for some reason? Or am I making a mistake elsewhere?

I am aware this is probably a very dumb question, so I thank you very much for your attention and help!

• Well that $a^2/2$ term is a constant. Usually just a big $+C$. If you differentiate both, you get the same answer. – combinatorialist46Carey2 Jun 20 at 19:31

$$\int(x-a)dx = x^2/2 - ax + C_1$$ $$\int u dx = u^2/2 = (x-a)^2/2 = x^2/2-ax+a^2/2 + C_2$$ and these two are as equal as they can be, as $$a^2/2$$ is a constant you can pick $$C_1 = a^2/2 + C_2$$.
Remember that for an indefinite integral you must add a constant of integration. The two integrals are then the same in terms of their dependence on $$x$$, up to a constant. If you would replace the indefinite integral with a definite integral, the difference would work out in how the bounds of the integral change when you make the change of variables.