The sentence that has an infinitive phrase that functions as the subject is the last one - To convert sunlight and energy into food is the end result of photosynthesis.
An infinitive is formed with the preposition to and any verb. For example: to play, to dance, to see, etc.
In the first sentence, to the roots is not an infinitive since roots is not a verb, but a noun.
In the second sentence, to take is indeed an infinitive, but it is not a subject.