  In this paper we classify curves of genus 2 with group of automorphisms
isomorphic to D_8 or D_12 over an arbitrary field k (of characteristic
different from 2 in the D_8 case and from 2 and 3 in the D_{12} case) up to
k-isomorphism.
  As an application of the classification of curves of genus 2 obtained, we get
precise arithmetic information on their elliptic quotients and on their
jacobians. Over the field k=Q, we show that the elliptic quotients of the
curves with automorphisms D_8 and D_{12} are precisely the Q-curves of degrees
2 and 3, respectively, and we determine which curves have jacobians of
GL_2-type.
