I am having trouble understanding the validity of integrating both sides of an equation. I understand that an operation/manipulation can be performed to both sides of an equation, preserving the equality, eg. if two sides of an equation are equal, their derivatives are equal and hence it is valid to differentiate both sides.
However, when it comes to integrating both sides of an equation I feel a bit uneasy. I will try to explain my concern through an example.
Take the equation $x=x$
integrating both sides,
$\int x$ = $\int x$
$x^2/2 + c$ = $x^2/2 + d$
where c and d are constants.
Surely this only makes sense if c=d, but I see no reason why this should be the case as c and d can assume any constant following integration. Thus I don't see why integrating both sides of an equation is a legal thing to do (although I know it is). I'm hoping that someone can resolve this for me. Thank you.