The affinity of the (001) and of the water reacted (010)WR hydroxyapatite surfaces towards formic and alendronic acids is studied with density functional theory (PBE functional) using periodic boundary conditions based on Gaussian basis set. Structures, energetic of the adsorption and vibrational features of the adsorbates are computed in order to understand at the atomic level both the cariogenic processes (for the formic acid) and the features of anti-osteoporosis drugs (for the alendronic acid). For both molecules the interaction energy is very high on an absolute scale, and for all examined cases, it is higher on the (010)WR HA surface than on the (001) one. For the latter, a number of cases by which the acidic proton of the adsorbate is transferred to the HA surface are also characterized. For the formic acid case, experimental infrared spectra are also measured and the position and nature of the C=O stretching bands have been found to be in excellent agreement with the quantum mechanical simulations. For alendronic acid IR experiments are still not available and the present predicted infrared spectra will be useful as a guide to interpret future experimental studies.