  We study $D\bar{D}^*$ ($D^*\bar{D}$) scattering in the framework of
unitarized heavy meson chiral perturbation theory with pion exchange and a
contact interaction. $^3S_1-$$^3D_1$ mixing effects are taken into account. A
loosely bound state X(3872), with the pole position being
$M_{pole}=(3871.70-i0.39)\mathrm{MeV}$, is found. The result is not sensitive
to the strength of the contact interaction. Our calculation provides a
theoretical confirmation of the existence of the $1^{++}$ state X(3872). The
light quark mass dependence of the pole position indicates it has a
predominately $D\bar{D}^*$ ($D^*\bar{D}$) molecular nature. When the $\pi$ mass
is larger than 142 MeV, the pole disappears which makes impossible the lattice
simulation of this state at large quark mass.
