  Investigations of two resonant planets orbiting a star or two resonant
satellites orbiting a planet often rely on a few resonant and secular terms in
order to obtain a representative quantitative description of the system's
dynamical evolution. We present a semianalytic model which traces the orbital
evolution of any two resonant bodies in a first- through fourth-order
eccentricity or inclination-based resonance dominated by the resonant and
secular arguments of the user's choosing. By considering the variation of
libration width with different orbital parameters, we identify regions of phase
space which give rise to different resonant ''depths,'' and propose methods to
model libration profiles. We apply the model to the GJ 876 extrasolar planetary
system, quantify the relative importance of the relevant resonant and secular
contributions, and thereby assess the goodness of the common approximation of
representing the system by just the presumably dominant terms. We highlight the
danger in using ''order'' as the metric for accuracy in the orbital solution by
revealing the unnatural libration centers produced by the second-order, but not
first-order, solution, and by demonstrating that the true orbital solution lies
somewhere ''in-between'' the third- and fourth-order solutions. We also present
formulas used to incorporate perturbations from central-body oblateness and
precession, and a protoplanetary or protosatellite thin disk with gaps, into a
resonant system. We quantify these contributions to the GJ 876 system, and
thereby highlight the conditions which must exist for multi-planet exosystems
to be significantly influenced by such factors. We find that massive enough
disks may convert resonant libration into circulation; such disk-induced
signatures may provide constraints for future studies of exoplanet systems.
