Only idempotent elements of a ring 
Show that the only idempotent elements of $\mathbb R[X,Y]/(XY)$ is $0$ and $1$, where $\mathbb R[X,Y]$ is the polynomial ring over real number.

Please help me to solve this if any one have any idea.
 A: Here's another way. If $e$ is an idempotent, and $P$ is a prime ideal, exactly one of $e$ or $1-e$ lies in $P$.
It's easy to see there are two minimal prime ideals in this ring: $(x)$ and $(y)$.
Suppose there is a nontrivial idempotent. Then a nontrivial idempotent, call it $e$, lies in $(x)$. If $e\in(y)$ as well, $e=e^2\in (xy)=\{0\}$ so clearly $e\notin (y)$. Then $1-e\in (y)$. But that would imply $1\in (x)+(y)$, which is false. 
The only conclusion then is that there is no nontrivial idempotent.
This generalizes to any case which you can find two prime ideals with trivial intersection and which are not comaximal.
A: Let $P(X,Y)+(XY)$ be an idempotent element. That means that$$P(X,Y)^2+(XY)=P(X,Y)+(XY),$$or, in other words, $P(X,Y)^2-P(X,Y)\in(XY)$. Still another way saying this is that$$P(X,Y)\bigl(P(X,Y)-1\bigr)\in(XY)\tag1.$$ There are three possibilities:


*

*The constant term of $P(X,Y)$ is neither $0$ nor $1$. Then the constant term of $P(X,Y)\bigl(P(X,Y)-1\bigr)$ is not $0$ and therefore $(1)$ does not take place.

*The constant term of $P(X,Y)$ is $0$. Since $P(X,Y)\bigl(P(X,Y)-1\bigr)\in(XY)$, $X\mid P(X,Y)\bigl(P(X,Y)-1\bigr)$. But $X\nmid P(X,Y)-1$ (because its constant term is $-1$). Therefore, $X\mid P(X,Y)$. For the same reason $Y\mid P(X,Y)$. Therefore, $P(X,Y)\in(XY)$.

*The constant term of $P(X,Y)$ is $1$. By a similar argument then $P(X,Y)-1\in(XY)$.


Therefore, $P(X,Y)+(XY)=(XY)$ or $P(X,Y)-1\in(XY)$. In other words, $P(X,Y)$ is equal to $0$ or to $1$ in $\mathbb{R}[X,Y]/(XY)$.
