  Stanley introduced the concept of chromatic symmetric functions of graphs
which extends and refines the notion of chromatic polynomials of graphs, and
asked whether trees are determined up to isomorphism by their chromatic
symmetric functions. Using the technique of differentiation with respect to
power-sum symmetric functions, we give a positive answer to Stanley's question
for the class of trees with exactly two vertices of degree at least 3. In
addition, we prove that for any tree $T$, the generalized degree sequence for
subtrees of $T$ is determined by the chromatic symmetric function of $T$,
providing evidence to a conjecture of Crew.
