"Can you close the door?" is moderately polite but it's more an order (e.g., from parents to children) than a request.
The following are examples of requests: "Would you please close the door?" and "Would you be so kind as to close the door?"
I rather like the second one, because it gives the other person time to focus attention on your request. While you are saying "Would you be so kind as to...", the other person is listening and waiting to find out just what you're asking. Even if they missed the first few syllables, by the time you reach "close the door", you have their full attention.
Benjamin, the can/may distinction in English is more for if you're asking permission to do something, not if you're asking someone to do something for you.
"Can you close the door" is polite, but as has already been said, those who take things literally will make a joke out of it and act like you're asking them if they are ABLE to close the door.
In English, you wouldn't say, "can you TO CLOSE the door?" so when do you use the infinitive form in Esperanto?
In esperanto, you use the infinitive whenever you have a verb that refers to an action, ie the verb is acting on another verb. Here, the verb 'povas' (can) is referring to the action of closing (fermi), so it has to be the infinitive. Povas, provas, ŝatas, bezonas and devas are all verbs that are likely to act on the infinitive of another verb.
They actually come from Latin, which is also the main root for Romance languages such as French (and Spanish, Italian, and Portuguese).
English, on the other hand, is about half Latin and half Germanic, with many of our more basic words coming from the latter source.
Someone else already asked that question. And althyastar answared: "Yes. It depends on context. "Can" can be a more causal way of saying "would you please" or "may I," etc. It's not technically grammatically correct, I believe, but that is what you'll hear most often in English."