In this paper , we will study the ability to solve Pell's equation in the set Z, we give necessary and sufficient conditions to solve this equation , depending on the ideals in orders of the real quadratic fields .We also introduce the formula of the opposite ideal for every solution of this equation , in special cases.