Find all polynomials $P(x)$ with real coefficients satisfying $P(x-1)P(x+1)=P(P(x))$
I tried $P(x) = c$ (const) and got $c=0$ or $c=1$. But when I tried $P(x)=a_{n}x^{n}+a_{n-1}x^{n-1}+...+a_{0}$, normally I would be able to find $a_{n}$ but in this case, both highest coefficients on the two sides is $a_{n}^{2}$ so I can't find it.
I don't know how to progress in this problem. Any help would be highly appreciated!
P/s: With the help of @Theo Bendit, I come up with this solution.
Let $\deg(P(x))=n$, then $\deg(LHS)=2n$ while $\deg(RHS)=n^{2}$ => $n=2$ (as $n=0$ then I have done it above). Therefore, $P(x)=ax^{2}+bx+c$.
We see that for $x^{4}$, we have $a^2=a^3 => a=1$ and we can do the same for $b$ and $c$.
In the end, we get $P(x)=x^2-2x+1$ is a solution.
$P(x)=x^2-2x+1$
$P(x+1)P(x-1)=P(P(x))$
Let's say that $P(x)$ has degree $n$. That means that $P(x+1)$ and $P(x-1)$ will each have degree $n$ too. Their product will consequently be of degree $2n$ (because $x^n$ times $x^n$ is $x^{2n}$).
The right-hand side will have a degree of $n^2$ because $P(x)$ is of degree $n$ and $P(\textit{something of degree n})$ will return something of degree $n^2$.
We can therefore conclude since both sides must have the same degree, that $n^2=2n$ and $n$ either equals $2$ or $0$. A zero-degree polynomial is a cheeky answer, so let's just say that $P(x)$ is of degree $2$, or a quadratic.
$P(x)=ax^2+bx+c$
$P(x+1)=a(x+1)^2+b(x+1)+c=a(x^2+2x+1)+b(x+1)+c=ax^2+2ax+a+bx+b+c$
$P(x-1)=a(x-1)^2+b(x-1)+c=a(x^2-2x+1)+b(x-1)+c=ax^2-2ax+a+bx-b+c$
$P(x+1)P(x-1)=(ax^2+2ax+a+bx+b+c)(ax^2-2ax+a+bx-b+c)$
Getting a calculator to evaluate this...
$\space=(a^2 - b^2 + 2 a c + c^2)+ (- 2 a b + 2 b c )x+( - 2 a^2 + b^2 + 2 a c)x^2 + (2 a b) x^3 + (a^2 )x^4$
Next up is evaluating that $P(P(x))$
Since $P(x)=ax^2+bx+c$,
$P(P(x))=a(ax^2+bx+c)^2+b(ax^2+bx+c)+c$
$=(a^3) x^4 + (2 a^2 b )x^3 + (2 a^2 c + a b^2 + a b)x^2 + (2abc+ + b^2 )x + (b c + c+ac^2)$
$ $
$(a^2 - b^2 + 2 a c + c^2)+ (- 2 a b + 2 b c )x+( - 2 a^2 + b^2 + 2 a c)x^2 + (2 a b) x^3 + (a^2 )x^4=(a^3) x^4 + (2 a^2 b )x^3 + (2 a^2 c + a b^2 + a b)x^2 + (2abc + b^2 )x + (b c + c+ac^2)$
Now I just have to match the $x^4$ coefficients with each other, then the $x^3$ coefficients, and so on.
$a^3=a^2$ so $a=1$
Matching the $x^2$ coefficients gives:
$2c+b^2+b=-2+b^2+2c$ so $b=-2$
Finally, evaluating the constant gives $-2c+c+c^2=1-4+2c+c^2$. Simplifying gives $c=1$
And so finally, we have our coefficients giving the polynomial $P(x)=x^2-2x+1$
Honestly, $P(x)=0$ was a better answer tho.