I was just playing around and came up with this 'method of expanding polynomials'. I start with $$(x+a)^2$$, the $a$ being a constant, which I differentiate to obtain $$2(x+a)$$ I multiply this out to obtain $$2x+2a$$ and integrate term by term to get $$ x^2+2ax+C $$ where I am losing a constant.
Now if I didn't want to lose the constant I would consider $(x+y)^2$ , or if I wanted to compute $(x+y+z)^2$, I would have to differentiate these expressions. The problem is that if I differentiate with respect to $x$, I lose all terms that depend only on $y$ (and $z$).
Is there a way to overcome this obstacle?
You have to find the constant of integration for our specific case. Specifically, you know that when $x = 0$, we have $(x+a)^2 = a^2$. That means that $a^2 = 0^2 + 2\cdot 0a + C = C$, so we get $C = a^2$.
ALternatively, you could use that when $x = -a$, we have $(x + a)^2 = 0$, which means that $0 = (-a)^2 + 2(-a)a + C = -a^2 + C$, again giving $C = a^2$.
Or, you could use any other value for $x$. They all tell you that $C = a^2$. The main point is that you have a funciton $2x + 2a$, and to this function you have the general antiderivative $x^2 + 2xa + C$, and you have a specific antiderivative $(x + a)^2$. In order to figure out which calue for $C$ gives you the specific antiderivative you're after, you need to evaluate the two somewhere and compare their values.