Why is 之 used in this sentence? 忍耐是幸福之门的一把钥匙. Cant it just as easily be substituted with 的? Please help me understand. Thanks.
之 and 的 are essentially synonyms for different contexts.
之 is mostly used in set phrases, idioms, proverbs, poems, etc. (Also math with percents and such: 百分*之*百 100 points out of 100. )
的 is more fit for colloquial contexts.
Since 忍耐是幸福之门的一把钥匙 "Patience is the key to the door of happiness" is a phrase, it is fit to use 之.
Another reason is to avoid using the same word again and again in the sentence. To make it easier to read and understand, in sentences where you get related 的, this adds variety.
is easier to understand than: