In recent years several pairs of extrasolar planets have been discovered in the vicinity of mean-motion commensurabilities . In some cases , such as the Gliese 876 system , the planets seem to be trapped in a stationary solution , the system exhibiting a simultaneous libration of the resonant angle \theta _ { 1 } = 2 \lambda _ { 2 } - \lambda _ { 1 } - \varpi _ { 1 } and of the relative position of the pericenters . In this paper we analyze the existence and location of these stable solutions , for the 2/1 and 3/1 resonances , as function of the masses and orbital elements of both planets . This is undertaken via an analytical model for the resonant Hamiltonian function . The results are compared with those of numerical simulations of the exact equations . In the 2/1 commensurability , we show the existence of three principal families of stationary solutions : ( i ) aligned orbits , in which \theta _ { 1 } and \varpi _ { 1 } - \varpi _ { 2 } both librate around zero , ( ii ) anti-aligned orbits , in which \theta _ { 1 } = 0 and the difference in pericenter is 180 degrees , and ( iii ) asymmetric stationary solutions , where both the resonant angle and \varpi _ { 1 } - \varpi _ { 2 } are constants with values different of 0 or 180 degrees . Each family exists in a different domain of values of the mass ratio and eccentricities of both planets . Similar results are also found in the 3/1 resonance . We discuss the application of these results to the extrasolar planetary systems and develop a chart of possible planetary orbits with apsidal corotation . We estimate , also , the maximum planetary masses in order that the stationary solutions are dynamically stable .