  Let $F$ be a finitely generated free group and let $H\le F$ be a finitely
generated subgroup. Given an element $g\in F$, we study the ideal
$\mathfrak{I}_g$ of equations for $g$ with coefficients in $H$, i.e. the
elements $w(x)\in H*\langle x\rangle$ such that $w(g)=1$ in $F$. The ideal
$\mathfrak{I}_g$ is a normal subgroup of $H*\langle x\rangle$, and we provide
an algorithm, based on Stallings folding operations, to compute a finite set of
generators for $\mathfrak{I}_g$ as a normal subgroup.
  We provide an algorithm to find an equation in $\mathfrak{I}_g$ with minimum
degree, i.e. an equation $w(x)$ such that its cyclic reduction contains the
minimum possible number of occurrences of $x$ and $x^{-1}$; this answers a
question of A. Rosenmann and E. Ventura. More generally, we provide an
algorithm that, given $d\in\mathbb{N}$, determines whether $\mathfrak{I}_g$
contains equations of degree $d$ or not, and we give a characterization of the
set of all the equations of that specific degree. We define the set $D_g$ of
all integers $d$ such that $\mathfrak{I}_g$ contains equations of degree $d$;
we show that $D_g$ coincides, up to a finite set, either with the set of
non-negative even numbers or with the set of natural numbers.
  Finally, we provide examples to illustrate the techniques introduces in this
paper. We discuss the case where $\text{rank}(H)=1$. We prove that both kinds
of sets $D_g$ can actually occur. The examples also show that the equations of
minimum possible degree aren't in general enough to generate the whole ideal
$\mathfrak{I}_g$ as a normal subgroup.
