Which sentence is correct and why? with 'to' or without 'to'

  1. All I can do is to tell her not to go out during the weekend.

  2. All I can do is tell her not to go out during the weekend.


Solution 1:

All I can do is [tell her not to go out during the weekend].

The bracketed element is a predicative complement of "be" in a reversible specifying construction, where the complement can be a to- infinitival or a bare infinitival (or a gerund participial)

Note, though, that the bare infinitival is restricted to cases where the subject noun phrase contains "do" in a relative clause, as it does here.

"To" can optionally be added here (All I can do is to tell ...)