The formula :-
\begin{equation}\tag{A}
\frac{1}{P_{sid}^{-1}-P_{syn}^{-1}} = P_{e}
\end{equation}
(where $P_{e}$ is the sidereal period of the Earth in its orbit around the Sun)
can be derived with the aid of Fig. 1 below, using the different axes frames, and making the following simplifying assumptions about the motions of the Sun, Earth and Moon :-
Earth has a circular orbit around the Sun of constant speed and a fixed period $P_{e}$
Moon has a circular orbit around the Earth of constant speed and a fixed period $P_{sid}$. (Thus the moon's path wrt the fixed Sun frame is an epicycle, ie a small circle whose center moves along the circumference of a larger circle, in this case the Earth's orbit).
The above two orbits are confined to a common plane (the Ecliptic Plane)
From the direction we are viewing (ie `North') both Earth and Moon orbit in the anti-clockwise direction
In the diagram the angles $\theta$, $\phi$, $\psi$, and $\pi + \theta$ are all `polar coordinate angles' wrt the relevant $x$-axis. The axes-frame $x'y'$ always points towards the Sun, and it moves with the Earth in its orbit. The $y'$ axis is the 'noon line' always pointing towards the Sun. The phases of the Moon are determined by the phase angle $\psi$ which the Moon makes wrt the $x'$ axis :-
Conjunction means in line with and in same direction as the Sun, opposition means in line with but in opposite direction as the Sun.
From the diagram it is readily seen that :-
$$\psi = \pi/2 + (\phi - \theta)$$
But we could write :-
\begin{eqnarray*}
\theta & = & \omega_{e}t + \theta_{0} \\
\phi & = & \omega_{m}t + \phi_{0} \\
\end{eqnarray*}
where $\omega_{e}$ = constant angular velocity of the Earth (radians per second), $\omega_{m}$ = constant angular velocity of the Moon, and $\theta_{0}$, $\phi_{0}$ are the angles at time $t$ = $0$.
Thus
$$\psi = (\omega_{m} - \omega_{e})t + (\phi_{0} - \theta_{0}) + \pi/2$$
and so change $\Delta \psi$ in $\psi$ after a time $\Delta t$ is given by
$$\Delta\psi = (\omega_{m} - \omega_{e}) \Delta t$$
Thus moon phase angle $\psi$ varies linearly with time at the constant rate of $\omega_{m} - \omega_{e}$.
Since $\omega_{m} = 2\pi / P_{sid}$ and $\omega_{e} = 2\pi / P_{e}$ we then have
$$\Delta\psi = 2\pi (1 / P_{sid} - 1 / P_{e}) \Delta t$$
The synodic period of the moon is simply the time it takes for moon phase angle $\psi$ to make a full cycle, ie $2\pi$ radians (= $360^{\circ}$) so putting $\Delta \psi$ = $2\pi$ in the latter formula gives $P_{syn}$ = $\Delta t$ ie
$$P_{syn} = \frac{1}{1 / P_{sid} - 1 / P_{e}}$$
or
$$\frac{1}{P_{syn}} = \frac{1}{P_{sid}} - \frac{1}{P_{e}}$$
which is easily rearranged to obtain the required formula (A). In short we are just subtracting two angular velocities -- but these go by the reciprocal of the relevant orbital period $P$, hence the reciprocals in the formula.
Taking the values $P_{sid} = 27.321661$ days (from https://en.wikipedia.org/wiki/Moon))) and $P_{e} = 365.256363$ days (from https://en.wikipedia.org/wiki/Sidereal_year) this gives as the moon's synodic period :-
$$P_{syn} = 29.530588 \mbox{ days}$$
which differs by only 0.000001 from the Wikipedia value of 29.530589 days, where 'day' is SI day = 86,400 SI seconds).
So the figures given on Wikipedia for these three orbital periods $P_{syn}$, $P_{sid}$, and $P_{e}$ are very closely related by the formula (A), so that one of them has been calculated from the other two. Thus these are not entirely actual experimentally observed figures that have been quoted on Wikipedia (nor on WolframAlpha). For we could NOT expect the actual figures to be related so exactly by the formula (A) because of the simplifying assumptions (1) - (4) above that are required to derive that formula (the actual orbits are not perfectly circular and they are not exactly in the same plane).
(NOTE: The figure I have for $P_{e}$ is 365.256363 days, and for the tropical year 365.242189 days, from Wikipedia (https://en.wikipedia.org/wiki/Sidereal_year), where 'day' is SI day = 86,400 SI seconds. This differs slightly from the values you have quoted.)
A reciprocal type formula is also applicable to the synodic period between two planets orbiting the Sun (see Fig. 2 below), again with the simplifying assumptions of circular orbits in the same plane :-
$$\frac{1}{P_{syn}} = \frac{1}{P_{1}} - \frac{1}{P_{2}}$$
where $P_{1}$ and $P_{2}$ are the orbital periods of the planets, and $P_{1} < P_{2}$.
This same type of formula is derived because :-
$$\psi = \phi - \theta$$
and so the above derivation applies very similarly.