  In this paper, we consider a natural generalization of the concept of order
of an element in a group: an element $g \in G$ is said to have order $k$ in a
subgroup $H$ of $G$ (\resp \wrt a coset $Hu$) if $k$ is the first strictly
positive integer such that $g^k \in H$ (\resp $g^k \in Hu$). We study this
notion and its algorithmic properties in the realm of free groups and some
related families.
  Both positive and negative (algorithmic) results emerge in this setting. On
the positive side, among other results, we prove that the order of elements,
the set of orders (called spectrum), and the set of preorders (\ie the set of
elements of a given order) \wrt finitely generated subgroups are always
computable in free and free times free-abelian groups. On the negative side, we
provide examples of groups and subgroups having essentially any subset of
natural numbers as relative spectrum; in particular, non-recursive and even
non-recursively enumerable sets of natural numbers. Also, we take advantage of
Mikhailova's construction to see that the spectrum membership problem is
unsolvable for direct products of nonabelian free groups.
