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!

Don't keep forgetting the constant of integration please :P
$$\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$.
