# Union, intersection and complementary of intervals

## Union of intervals

Given two any real intervals, its union is a set that consists of all the elements that belong to the first interval and all the elements that belong to the second one.

The union of the intervals $$(a,b)$$ and $$(c,d)$$ is denoted as $$(a,b)\cup (c,d)$$ and is calculated this way:

$$(a,b)\cup (c,d) = \{ x\in\mathbb{R} \ | \ x\in(a,b) \ \mbox{or} \ x\in(c,d)\}=$$$$$=\{ x\in\mathbb{R} \ | \ a < x < b \ \mbox{or} \ c < x < d\}$$$

Depending on the order in which numbers $$a, b, c$$ and $$d$$ are, the result will be different. Being $$(a,b)$$ and $$(c,d)$$ two intervals, we have $$a < b$$ and $$c < d$$, but the relative position of the endpoints of an interval may change regarding the endpoints of the other one. Thus, we find the cases, as follows:

• if $$a < b < c < d$$ then the union $$(a,b) \cup (c,d)$$ results in the set formed by two intervals: $$(a,b) \cup (c,d) = \{ x\in\mathbb{R} \ | \ x\in(a,b) \ \mbox{or} \ x\in(c,d) \}$$$The result is the same if $$c < d < a < b.$$ • if $$a < c < d < b$$, then the interval $$(c,d)$$ is included in $$(a,b)$$, so, $$(a,b) \cup (c,d) = \{ x\in\mathbb{R} \ | \ a < x < b, \ \mbox{or} \ c < x < d\} =$$$ $$= \{ x\in\mathbb{R} \ | \ a < x < b\}=$$$$$=(a,b)$$$

Similarly, if $$c < a < b < d$$, we obtain $$(a,b) \cup (c,d)=(c,d)$$. That is, if an interval is included into another one, the union of the two is equal to the greater one.

• if $$c < a < d < b$$, then we have $$(a,b) \cup (c,d) = \{ x\in\mathbb{R} \ | \ a < x < b, \ \mbox{or} \ c < x < d\}$$$But as $$c < a$$ and $$d < b$$, we have two intervals that overlap so we have a unique interval: $$(a,b) \cup (c,d) = \{ x\in\mathbb{R} \ | \ c < x < b\} = (c,b)$$$

In the same way, if $$a < c < b < d$$ we obtain: $$(a,b) \cup (c,d) = \{ x\in\mathbb{R} \ | \ a < x < d\} = (a,d)$$$Note now that the union of intervals is not always an interval. Furthermore, in the case of open intervals, either closed or mixed, the result is analogous: Consider for example the union of the intervals $$(3,9)$$ and $$[7,11]$$: $$(3,9) \cup [7,11] = \{ x\in\mathbb{R} \ | \ 3 < x < 9, \ \mbox{or} \ 7 < x < 11\} =$$$ $$= \{x\in\mathbb{R} \ | \ 3 < x \leq 11\}=(3,11]$$$So, $$(3,9) \cup [7,11] = (3,11].$$ In this case the union of two intervals has given us an interval. Another example, let's do the union of the intervals $$(-1,0)$$ and $$(0,+\infty)$$: $$(-1,0) \cup (0,+\infty) = \{ x\in\mathbb{R} \ | \ -1 < x < 0, \ \mbox{or} \ 0 < x \}$$$ And this expression can not be simplified, such that the union of the intervals $$(-1,0)$$ and $$(0,+\infty)$$ remains $$(-1,0) \cup (0,+\infty)$$$## Intersection of intervals Given any two real intervals, their intersection is the set of all elements that belong to both intervals. The intersection of intervals $$(a,b)$$ and $$(c,d)$$ is denoted as $$(a,b)\cap(c,d)$$$ and is calculated as: $$(a,b)\cap (c,d) = \{ x\in\mathbb{R} \ | \ x\in(a,b) \ \mbox{and} \ x\in(c,d)\}=$$$$$=\{ x\in\mathbb{R} \ | \ a < x < b \ \mbox{and} \ c < x < d\}$$$

Depending on the order in which the numbers $$a, b, c$$ and $$d$$ are, the result will be one or another. As in the union, we have that $$a < b$$ and $$c < d$$, but the relative position of the endpoints may change compared to the extremes of the other interval. Thus, we find the cases, as follows:

• if $$a < c < d < b$$, we have that the interval $$(c,d)$$ is included in $$(a,b)$$, then, $$(a,b) \cap (c,d) = \{ x\in\mathbb{R} \ | \ a < x < b, \ \mbox{and} \ c < x < d\} =$$$$$= \{ x\in\mathbb{R} \ | \ a < c < x < d < b\}=$$$ $$=(c,d)$$$Similarly, if $$c < a < b < d$$, we obtain $$(a,b) \cap (c,d)=(a,b)$$. Namely, if an interval is included into another, the intersection of the two is equal to the lower one. • if $$c < a < d < b$$, then we have that $$(a,b) \cap (c,d) = \{ x\in\mathbb{R} \ | \ a < x < b, \ \mbox{and} \ c < x < d\} =$$$ $$=\{x\in\mathbb{R} \ | \ c < a < x < d < b\} =$$$$$=(a,d)$$$

In the same way, if $$a < c < b < d$$, we obtain: $$(a,b) \cap (c,d) = \{ x\in\mathbb{R} \ | \ b < x < c\} = (b,c)$$$• if $$a < b < c < d$$ then the intersection $$(a,b) \cap (c,d)$$ is: $$(a,b) \cap (c,d) = \{ x\in\mathbb{R} \ | \ x\in(a,b) \ \mbox{and} \ x\in(c,d) \}$$$
but as $$b < c$$, there's no value $$x$$ that belongs to the two intervals at the same time. In this case we say that the intersection is empty and it is denoted by the symbol $$\emptyset$$: $$(a,b) \cap (c,d)=\emptyset.$$$The result is the same if $$c < d < a < b$$. In the case of two intervals which intersection is empty, we say that these intervals are disjoint. The concept empty, $$\emptyset$$, is also considered as an interval, because $$\emptyset=(a,a)$$ for any real number $$a$$, so, unlike the union, the intersection of intervals is always an interval, but you can obtain the particular case of the empty interval. An example of intersection. Consider the intervals $$[0,+\infty)$$ and $$(-\infty,1)$$. Then its intersection is: $$[0,+\infty) \cap (-\infty,1) = \{ x\in\mathbb{R} \ | \ 0 \leq x \ \mbox{and} \ x < 1\} =$$$ $$=\{x\in\mathbb{R} \ | \ 0 \leq x < 1 \} =$$$$$=[0,1)$$$

## Complementary

The complementary step is an operation that affects a single interval.

Given an interval any, its complementary is the set of numbers that do not belong to the interval.

We denote the complementary of the interval $$J=(a,b)$$ as $$\overline{J}=\overline{(a,b)}$$$To calculate it we will see the different cases if it is a bounded or unbounded interval: • if the interval is bounded, we have: $$\overline{(a,b)}= \{ x\in\mathbb{R} \ | \ x\notin (a,b)\} =$$$ $$=\{ x\in\mathbb{R} \ | \ x\leq a, \ \mbox{or} \ b\leq x\}=$$$$$=(-\infty,a]\cup [b,+\infty)$$$

• if the interval is unbounded, we have: $$\overline{(-\infty,b)}= \{ x\in\mathbb{R} \ | \ x\notin (-\infty,b)\} =$$$$$=\{ x\in\mathbb{R} \ | \ b\leq x\}=$$$ $$=[b,+\infty)$$$Similarly, $$\overline{(a,+\infty)}= \{ x\in\mathbb{R} \ | \ x\notin (a,+\infty)\} =$$$ $$=\{ x\in\mathbb{R} \ | \ x\leq a\}=$$$$$=(-\infty,a]$$$

In the particular case of the empty interval, $$\emptyset$$, we have that its complementary are all the elements that do not belong to $$\emptyset$$, but as it doesn't have any element $$\emptyset$$, then the complementary is the total: $$\overline{\emptyset}=\{ x\in\mathbb{R} \ | \ x\notin \emptyset= \mathbb{R}\}$$\$

It should be noted that the total is also an interval, as: $$\mathbb{R}=(-\infty,+\infty)$$.