Describe the idempotents in a polynomial ring $R[x]$. In general, given that $R$ is a commutative ring, how to identify the idempotent elements in $R[x]$?


I tried by solving equalities of polynomials but nothing works...

So how can I see that in which form can we get some idempotents in $R[x]$?

Thanks in advance!
$f^2 = f\,\Rightarrow f(0)^2\! = f(0) := a.\,$ If $\,f\!-\!a\ne 0\,$ it has order $\,k\ge 1,\,$ say $\,f = a + bx^k+\cdots,\,b\ne 0.\,$ Then $\,f^2\! = f\,\Rightarrow 2ab = b,\,$ times $\,a\,\Rightarrow\,2ab = ab\,\Rightarrow\,ab=0\,\Rightarrow\,b = 2ab = 0,\,$ contradiction. Therefore $\,f = a = f(0)\,$ is constant.
CASE I:$R$ is an integral domain .Then $p(x)^2=p(x)\implies \deg p(x)=0\implies p(x) \text{is a constant}$ 

So the idempotents in $R[x]$ are only the idempotents in $R$.

CASE II:$R$ is not an integral domain .Here though the idempotents in $R$ will be idempotents in $R[x]$ it can't be said whether they will be the only idempotents or not.