  Monte Carlo computer simulations are used to study the conformational free
energy of a folded polymer confined to a long cylindrical tube. The polymer is
modeled as a hard-sphere chain. Its conformational free energy $F$ is measured
as a function of $\lambda$, the end-to-end distance of the polymer. In the case
of a flexible linear polymer, $F(\lambda)$ is a linear function in the folded
regime with a gradient that scales as $f\equiv |dF/d\lambda| \sim N^0
D^{-1.20\pm 0.01}$ for a tube of diameter $D$ and a polymer of length $N$. This
is close to the prediction $f \sim N^0 D^{-1}$ obtained from simple scaling
arguments. The discrepancy is due in part to finite-size effects associated
with the de-Gennes blob model. A similar discrepancy was observed for the
folding of a single arm of a three-arm star polymer. We also examine
backfolding of a semiflexible polymer of persistence length $P$ in the classic
Odijk regime. In the overlap regime, the derivative scales $f \sim N^0
D^{-1.72\pm 0.02} P^{-0.35\pm 0.01}$, which is close to the prediction $f \sim
N^0 D^{-5/3} P^{-1/3}$ obtained from a scaling argument that treats
interactions between deflection segments at the second virial level. In
addition, the measured free energy cost of forming a hairpin turn is
quantitatively consistent with a recent theoretical calculation. Finally, we
examine the scaling of $F(\lambda)$ for a confined semiflexible chain in the
presence of an S-loop composed of two hairpins. While the predicted scaling of
the free energy gradient is the same as that for a single hairpin, we observe a
scaling of $f \sim D^{-1.91\pm 0.03} P^{-0.36\pm 0.01}$. Thus, the quantitative
discrepancy between this measurement and the predicted scaling is somewhat
greater for S-loops than for single hairpins.
