  We prove an existence and uniqueness result for solutions $\varphi$ to a
weighted pendulum equation in $\mathbb{R}$ where the weight is non-smooth and
coercive. We also establish (in)stability results for $\varphi$ according to
the monotonicity of the weight. These results are applied in a reduced model
for thin ferromagnetic nanowires with notches to obtain existence, uniqueness
and stability of domain walls connecting two opposite directions of the
magnetization.
