  Bacterial flagella assume different helical shapes during the tumbling phase
of a bacterium but also in response to varying environmental conditions.
Force-extension measurements by Darnton and Berg explicitly demonstrate a
transformation from the coiled to the normal helical state [N.C. Darnton and
H.C. Berg, Biophys. J. {92}, 2230 (2007)]. We here develop an elastic model for
the flagellum based on Kirchhoff's theory of an elastic rod that describes such
a polymorphic transformation and use resistive force theory to couple the
flagellum to the aqueous environment. We present Brownian dynamics simulations
that quantitatively reproduce the force-extension curves and study how the
ratio $\Gamma$ of torsional to bending rigidity and the extensional rate
influence the response of the flagellum. An upper bound for $\Gamma$ is given.
Using clamped flagella, we show in an adiabatic approximation that the mean
extension, where a local coiled-to-normal transition occurs first, depends on
the logarithm of the extensional rate.
