Variational Problems for Tree Roots and Branches