Solution (source code)

= Solution

The <cotangent fiber translation> $f(q,p)=(q,p+\alpha_q)$ is a smooth diffeomorphism with inverse $(q,p)\mapsto(q,p-\alpha_q)$, and $\pi\circ f=\pi$. For a tangent vector $v$ at $(q,p)$, the intrinsic definition of the <canonical one-form on a cotangent bundle> gives
$$
(f^*\theta)_{(q,p)}(v)=(p+\alpha_q)(d\pi(v))=\theta_{(q,p)}(v)+(\pi^*\alpha)_{(q,p)}(v).
$$
Thus $f^*\theta=\theta+\pi^*\alpha$. Taking its <exterior derivative> with the fixed sign convention yields
$$
\boxed{f^*\omega=\omega-\pi^*(d\alpha)}.
$$
If $\alpha$ is a <closed differential one-form>, the last term vanishes, proving that $f$ is a <symplectomorphism>. In fact the converse holds too: the pullback by the zero section shows that $\pi^*(d\alpha)=0$ implies $d\alpha=0$.