# If $g:\mathbb{N}\rightarrow \mathbb{R}$ and $g(m+n)+g(m-n)=2g(m)+2g(n)$ what is $g(x)$

Determine all functions $g:\mathbb{N}\rightarrow \mathbb{R}$ such that $g(1)=1$ and $$g(m+n)+g(m-n)=2g(m)+2g(n), \quad \forall m\ge n \in \mathbb{N}$$

Because of the identity $k\cdot (a+b)^2 +k\cdot (a-b)^2=2k\cdot a^2+2k\cdot b^2$

I guess it is $g(x) = q\cdot x^2 \cdot$ and since $g(1)=1$ it is $q=1$ thus $g(x)=x^2$.

We have that $g(0)=0$ because, with $m=1,n=0$, $g(1)+g(1)=2g(1)+2g(0)$. Now $g(n+1)+g(n-1)=2g(n)+2g(1)$, thus $g(n+1)=2g(n)-g(n-1)+2$.
By induction, we suppose that $g(k)=k^2$ for $k\leq n$. This is true for $0$ and $1$. For $n+1$, we have $$g(n+1)=2n^2-(n-1)^2+2=2n^2-n^2+2n-1+2=n^2+2n+1=(n+1)^2.$$ The induction step is proved so $$g(n)=n^2 \ \ \ \forall n \in \Bbb N.$$
• Is that enough to say that $g(n)=n^2$ is the only function satisfying the above equation May 2, 2016 at 17:36
• Your answer proves that $g(n)=n^2$ is a function satisfying the above equation. It does not prove that $g(n)=n^2$ is the only function that satisfies the equation. Please correct me if I am wrong. May 2, 2016 at 18:08
• @user302454 I can see why this is not convincing. My proof goes as follows: $g$ is the square function on 0 and 1. I proved that if $g$ is the square function on $n$ and $n-1$, then it's the square function on $n+1$ (that's the induction step). So $g$ is the square function on 2, and then on 3, etc... Thus it is the square function on every integer. May 2, 2016 at 18:16
• I see, but may I ask how you would solve the problem: Determine all functions $f:\mathbb{R}\rightarrow \mathbb{R}$ such that $f(1)=1$ and $f(x+y)+f(x-y)=2f(x)+2f(y), \forall x,y \in \mathbb{R}$ May 2, 2016 at 18:29