This questions stems from an attempt to recast in a form suitable for teaching some standard computations which are usually proved by handwaving, without much care about the details. My hope is that some expert in this area is hanging around and can give me an immediate answer off the top of their head...
A function $f:I\to H$ from an interval of the reals into a Hilbert space is said to be scalarly integrable if $(f(t),x)$ is in $L^1(I)$ for all $x\in H$. This is sufficient to guarantee that for every measurable subset $E$ of $I$ one can find an $x_E\in H$ with the property $(x_E,x)=\int_E(f(t),x)dt$ for all $x\in H$. The vector $x_E$ is called the Pettis integral of $f$ over $E$. Now if $T:H\to K$ is a bounded map from $H$ to a second Hilbert space $K$, also $Tf$ is Pettis integrable and $T\int_E f=\int_E Tf$. This is quite easy to prove. I need the same property for any closed unbounded operator $T$. This kind of property is well known for stronger notions of integral (for the Bochner integral this is due to Hille), but I guess it is false in such generality for the Pettis integral.
Now my question: assume I know that $f:I\to H$ is scalarly integrable, thus has a Pettis integral, moreover it takes values into the domain $D(T)$, and the integrals $\int_E f$ are all contained in $D(T)$. Can I conclude that $Tf$ has a Pettis integral and $T\int_I f=\int_I Tf$?
EDIT: after an excellent series of posts, it seems that the question is almost settled, in the following sense. Assume in addition that $D(T)$ is densely defined dense and that $H$ is separable (or the interval $I$ is replaced by a discrete measure space). Then the result is true. This covers all the relevant applications, where the Hilbert spaces are some $L^2(R^n)$ and $T$ is a closed, densely defined operator like a differential operator possibly with variable coefficients.
I think Bill, Gerald and fedja should wrap up their arguments in a short paper, this can be useful to other people, and the mathematics is not trivial. On the other hand, I do not know which posts should be checked as answer; the final word is Gerald's but Bill's key argument on finite sums is quite cool. Tell me what to do :)