  The differential branching fraction with respect to the dimuon invariant mass
squared, and the $C\!P$ asymmetry of the $B^\pm\to\pi^\pm\mu^+\mu^-$ decay are
measured for the first time. The CKM matrix elements $|V_{td}|$ and $|V_{ts}|$,
and the ratio $|V_{td}/V_{ts}|$ are determined. The analysis is performed using
proton-proton collision data corresponding to an integrated luminosity of 3.0
fb$^{-1}$, collected by the LHCb experiment at centre-of-mass energies of 7 and
8 TeV. The total branching fraction and $C\!P$ asymmetry of
$B^\pm\to\pi^\pm\mu^+\mu^-$ decays are measured to be \begin{eqnarray}
\mathcal{B}(B^\pm\to\pi^\pm\mu^+\mu^-) &=& (1.83 \pm 0.24 \pm 0.05) \times
10^{-8}\,\,\,\mathrm{and} \nonumber\\
\mathcal{A}_{C\!P}(B^\pm\to\pi^\pm\mu^+\mu^-) &=& -0.11 \pm 0.12 \pm 0.01\,,
\nonumber \end{eqnarray} where the first uncertainties are statistical and the
second are systematic. These are the most precise measurements of these
observables to date, and they are compatible with the predictions of the
Standard Model.
