Find functions $f:\mathbb{N}\rightarrow \mathbb{N}$ such that $ f(m+n)=f(m)+f(n)+2mn$
Setting $m=n$ we see that: $$ f(2n)=2f(n)+2n^2$$
Setting $m=1$:
$$ f(n+1)=f(1)+f(n)+2n$$
Then, for example when $n=1$:
$$ f(2)=f(1)+f(1)+2=2f(1)+2$$
And we can observe that $f(n)=n^2$ satisfies the equations, as:
$$ f(m+n)=(m+n)^2=m^2+n^2+2mn=f(m)+f(n)+2mn$$
Then, if we assume that $f(n)=n^2+g(n)$, then we have:
$$ f(m+n)=(m+n)^2+g(m+n)=m^2+g(m)+n^2+g(n)+2mn $$ and so:
$$ g(m+n)=g(m)+g(n)$$ And that is Cauchy functional equation for natural numbers, so we see that we can only have $$g(n)=cn$$ for some $c$, so our solution would look like:
$$ f(n)=n^2+cn$$
And in this case:
$$ f(m+n)=(m+n)^2+c(m+n)$$ and $$f(m)+f(n)+2mn=m^2+cm+n^2+cn+2mn$$
so we see that $f(n)=n^2+cn$ is a solution. My question is:
is my solution correct? Does it suffice to do what I did to show that's the only one such function?
Hint Let $$g(n)=f(n)-n^2$$
Then $$g(m+n)=g(m)+g(n)$$
Then setting $g(1)=a$ what is $g(2), g(3),.., g(n)$?