  We have measured the extended x-ray absorption-fine-structure (EXAFS) at the
Y-K edge of YBa_2Cu_3O_x for x=6.801, 6.947, 6.968, 6.984 at T=20-300 K. Across
the underdoped-overdoped transition the Y-Cu2 pairs exhibit harmonic vibrations
which freeze out in the superconducting phase, whereas the Y-O2,3 pairs exhibit
strong anharmonicities with a singularity at T_c. In the underdoped regime the
average spacing O2,3-Cu2 increases with x due to displacements of Cu2 towards
Ba, but the average position of O2,3 along c is almost unaffected. Optimum
doping is a notable point in the x-T phase diagram, also concerning the lattice
degrees of freedom. Here the O2,3-Cu2 spacing (buckling) is largest, and in the
superconducting phase the Cu2 position along the c-axis is independent on
temperature. In the overdoped regime increasing x displaces the Cu2 along c
further towards Ba, but the O2,3 layer starts to shift in the same direction,
thus decreasing the O2,3-Cu2 spacing.
