This is page 68 Lemma 3.3 of Algebraic Geoemtry I by Gortz, Wedhorn
Lemma 3.3: Let $X$ be a scheme and let $U,V$ be affine open subschemes of $X$. There exists for all $x \in U \cap V$ an open subscheme $W \subseteq U \cap V$ with $x \in W$ such that it is principal open in $U$ as well as in $V$.
If $A$ is a ring, $f \in A$, the principal opens are subsets of $Spec(A)$, of the form $D(f):= Spec(A) \setminus V(f)$.
Proof: Replacing $V$ by a principal open subset of $V$ containing $x$, if necessary, we assume that $ V \subseteq U$. Now choose $f \in \Gamma(U,O_X)$ such that $x \in D(f) \subseteq V$ and let $f|_V$ denote the image of $f$ under the restriction homomorphism $\Gamma(U,O_X) \rightarrow \Gamma(V,O_X)$.
I suppose it should be $D_U(f)$?
Then $D_U(f) = D_V(f|_V)$
How does one obtain the last equality?