# Set Operations

### Union

The **union** of two sets is defined as the set of all elements in either set. We can write the union of two sets in set-builder notation as **A** ∪ **B** = { **x** | **x** ∈ **A** or **x** ∈ **B** }.

### Difference

The **difference** of two sets is defined as the set of all elements in the first set but that are not in the second set. We can write the difference of two sets in set-builder notation as **A** - **B** = { **x** | **x** ∈ **A** and **x** ∉ **B** }.

### Intersection

The **intersection** of two sets is defined as the set of all elements in both sets. We can write the intersection of two sets in set-builder notation as **A** ∩ **B** = { **x** | **x** ∈ **A** and **x** ∈ **B** }.

### Complement

The **complement** of a set is defined as the set of all elements in the universal set that are not in the set itself. We can write the complement of a set in set-builder notation as **U** - **A** = { **x** | **x** ∈ **U** and **x** ∉ **A** } or as -**A** = { **x** | **x** ∉ **A** } when the universal set is implied.

### Symmetric Difference

The **symmetric difference** of two sets is defined as the set of all elements in either set but not in both sets. We can write the symmetric difference of two sets in set-builder notation as **A** ∆ **B** = { **x** | **x** ∈ **A** - **B** or **x** ∈ **B** - **A** }.