# Necessary conditions for a function to have an antiderivative

Given an interval $$B \subseteq \mathbb{R}$$ and a function $$f : B \to \mathbb{R}$$, what are the necessary conditions (if any) on $$f$$ in order for it to have an antiderivative? Wikipedia lists some examples under the assumption that $$B$$ is an open interval. Are there any others? What if $$B$$ is not open?