To prove the addition of the square of two ideals of a ring is the ring itself. 
Let $I$ and $J$ are ideals of a commutative ring $R$ such that $I+J=R$. Then, is $I^2+J^2=R$ ?
If not, then what are the minimum conditions needed to prove the result above?

Please help me to solve this problem. Thanks in advance.
 A: The answer depends on what exactly your definition of a commutative ring is: whether it's required to have a multiplicative identity $1$ or not.
If $R$ does have a multiplicative identity $1$, then $1 = a + b$ for some $a \in I, b \in J$.  Then $1 = (a + b)^3 = (a + 3b) \cdot a^2 + (3a + b) \cdot b^2 \in I^2 + J^2$, so $I^2 + J^2$ is the entire ring.
If the definition of (commutative) ring you're using does not require a multiplicative identity $1$, then consider the subring of $\mathbb{Z}[x,y]$ generated by $x$ and $y$.  This is the subring of polynomials with a zero constant term.  Let $I := \langle x \rangle$ and $J := \langle y \rangle$.  Then $I^2 + J^2 = \langle x^2, y^2 \rangle$ is the ideal of polynomials such that the $x$, $y$, $xy$ coefficients are all zero.  In particular, $x \notin I^2 + J^2$, so $I^2 + J^2$ is not all of $R$.
A: In this case, $1=a+b$ with $a\in I$, $b\in J$. Squaring gives
$1=a^2+2ab+b^2$. Well, $a^2+b^2\in I^2+J^2$, but that pesky $2ab$
stops us from concluding that $1\in I^2+J^2$. Can we get around this
problem somehow?
