As far as I am concerned, after to be we cannot use a bare infinitive. However, I read some books and found some sentences in which bare infinitive is used after to be. E.g: What you need to do is write a well-organized essay
The above sentence is right or wrong? I suppose it should be :" what you need to do is to write...." What do you think?