Proof that two intervals suffice: there is no point in choosing an interval that is properly contained in another interval. Without loss of generality, then, let the intervals be [a1, b1], ..., [an, bn] such that a1 < ... < an. If no interval properly contains another interval, then b1 < ... < bn. For i < j < k, it holds that ([ai, bi] intersect [aj, bj] intersect [ak, bk]) = ([ai, bi] intersect [ak, bk]) and the same for union, so there is no reason to choose more than two intervals.
O(n log n)-time algorithm: reformulated, the problem is to find intervals [a, b] and [c, d] maximizing (d - a) * (b - c), since this product is negative iff the intervals do not intersect. Our algorithm is to do O(n log n) preprocessing that allows us to find the best mate for each interval in O(log n) time.
Let's work on finding the best mate for [a, b]. Do some algebra: (d - a) * (b - c) = d*b - d*c - a*b + a*c. Since a, b are fixed, we can drop the -a*b term and maximize the inner product <(a, b, 1), (d, c, -d*c)> over all intervals [c, d]. Since the set of vectors (d, c, -d*c) is fixed, this is essentially simulating the collision of a stationary polyhedron and a moving plane normal to (a, b, 1). Thanks to Edelsbrunner and Maurer (Finding extreme points in three dimensions and solving the post-office problem in the plane, 1984), there's an algorithm that preprocesses in time O(n log n) and solves queries of this type for different a and b in O(log n) time.
One sour detail is that we must choose at least two intervals but the best "solution" may be just the longest interval with itself. I'm confident that it's messy but possible to extend Edelsbrunner--Maurer to find the second most extreme point in the same running time.
[3,5],[-100,5], and[3,100]? Would you not pick all three? - Ray Toal[3,5]. But the union of all three is[-100, 100]. The value you have for this is also 400. Oh I see for this case why two intervals are sufficient. But are you sure in general? - Ray Toal