The set A and B should satisfy these two conditions,
1.
2.
For
From problem, A and B are ideal of a commutative ring R with unity,
So,
For element
As
For ax,
This indicates that,
As A and B are ideal, then for any
For
For,
So, the product
This indicates that,
So,
Here, both conditions are satisfied.