Short Answer: The gravitation of Jupiter and all the other planets makes Kepler’s third law a bit less accurate than it would be if their gravity were zero. The gravitational interaction between the planets, however, doesn’t have much effect on either the period or semi-major axis of any of the planets, especially in the short term.
Long Answer: You might be thinking of this pendulum motion expansion used to describe the orbital oscillations (including the big one between Jupiter and Saturn) here https://history.nasa.gov/SP-345/ch8.htm:
Where $\psi$ is the angle from the vertical, $\omega$ is the angular velocity, and $A^2$ is $g/l$, where $g$ is acceleration and $l$ is presumably the length of the pendulum.
Interplanetary resonances mostly result in precession of planet’s orbits, which are period and semi-major axis invariant. They mostly change just the longitude of the ascending node.
Other orbital changing effects between planets are Milankovitch cycles which are also period and semi-major axis invariant, according to Wikipedia:
Eccentricity varies primarily due to the gravitational pull of Jupiter
and Saturn. However, the semi-major axis of the orbital ellipse
remains unchanged; according to perturbation theory, which computes
the evolution of the orbit, the semi-major axis is invariant. The
orbital period (the length of a sidereal year) is also invariant,
because according to Kepler's third law, it is determined by the
semi-major axis.
The more significant effects that planetary mass have on adding inaccuracy to Kepler’s third law are through their gravitational effects on the sun when treated as individual two-body orbits.
Kepler’s “laws” describe the motion of the planets. Kepler arrived at these laws by examining observational data from the solar system in the late 1500s and the early 1600s. On page 48 of Epitome of Copernican Astronomy Kepler asked himself the question:
How is the ratio of the periodic times, which you have assigned to the
mobile bodies related to the aforesaid ratio of the spheres wherein
those bodies are borned?
And then answered:
The ratio of the times is not equal to the ratio of the spheres, but
greater than it, and in the primary planets exactly the ratio of the
3/2 powers.
A bit of translation is necessary here. The periodic times Kepler references are the orbital periods $p$ of the planets, and the spheres are the radii of the spheres which circumscribe the ellipses of the orbits. These are the same as the semi-major axes $a$ of the orbits.
So Kepler’s third law as stated was that, for every pair of planets 1 and 2, $(a_1/a_2)^{3/2}=p_1/p_2$. Our typical modern restatement of Kepler’s third law is that the ratio $a^3/p^2$ is the same for every planet.
Kepler thought that the sun was the center of the solar system. He didn’t realize that when a less massive object is in orbit with a more massive object, both objects actually rotate around their mutual center of gravity (called the barycenter). As Newton himself said (thanks UserLTK): “......Kepler knew ye Orb to be not circular but oval & guest it to be elliptical......”: from: arxiv.org/ftp/physics/papers/0107/0107009.pdf source of quote: H. W. Turnbull (ed.): The correspondence of Isaac Newton, II, Cambridge, 1960, pp. 436-437.
Kepler’s original values for the ratios were:
Kepler thought that “a more accurate number will be produced, if you take the times more accurately.” Kepler attributed all the inaccuracies in his data set to measurement error. However, Newton proved Kepler wasn’t quite correct.
Newton generalized Kepler’s third law as $$\frac{a^3}{p^2}=\frac{G(m_1+m_2)}{4\pi^2}$$, where G is the gravitational constant, $m_1$ is the mass of the sun, and $m_2$ is the mass of the planet, respectively. This generalization implies that $a^3/p^2$ will be different for each of the planets, since they all have different masses. The largest differences manifest for the planets with the highest masses, but even for Jupiter, these differences are along the third significant digit, consistent with our current best estimates here:
These values correspond well to my calculated predictions bases on Newton's generalization of Kepler's third law:
To repeat my short answer above, the gravitation of Jupiter and all the other planets makes Kepler’s third law a bit less accurate than it would be if their gravity were zero. The gravitational interaction between the planets, however, doesn’t have much effect on either the period or semi-major axis of any of the planets, especially in the short term.