Intervals

An interval is the set of all real numbers lying between two given numbers, with the endpoints either included or excluded. A square bracket marks an endpoint that belongs to the set, and a parenthesis marks one that does not. That single convention accounts for every notation in this section.

Quick Reference

Notation Set-builder form Name
[ a , b ] { x a x b } Finite, closed
( a , b ) { x a < x < b } Finite, open
[ a , b ) { x a x < b } Finite, half-open
( a , b ] { x a < x b } Finite, half-open
[ a , ) { x x a } Infinite, closed
( a , ) { x x > a } Infinite, open
( , b ] { x x b } Infinite, closed
( , b ) { x x < b } Infinite, open
( , ) The whole real line

Rules of thumb. A square bracket includes the endpoint, a parenthesis excludes it. The symbols and are not numbers, so they always take a parenthesis. To intersect two intervals, take the larger left endpoint and the smaller right endpoint.

In this section, we introduce the concept of intervals that are extensively used in calculus. The set of all real numbers that lie between two given numbers and may or may not include these end points is called an interval.

Closed interval [ a , b ] is the set of real numbers x that satisfy the inequalities a x b .

[ a , b ] = { x |   a x b } .

Open interval ( a , b ) is the set of real numbers x that satisfy the inequalities a < x < b .

( a , b ) = { x |   a < x < b } .

Another notation for the open interval ( a , b ) is ] a , b [ .

  • Note that the open interval ( a , b ) does not include its endpoints a and b , while the closed interval [ a , b ] include both of them.

We also have half-open intervals that include only one endpoint. In addition to finite intervals, we have infinite intervals that extend indefinitely in one or both directions. If an interval extends indefinitely in the positive direction, we write (or sometimes + ) in place of the right end and if it extends indefinitely in the negative direction, we write in place of the left end. All of these cases are shown in the following table.

  • We always denote the inclusion of an end in an interval by square bracket and its exclusion by a parenthesis.
  • The symbols and (read "infinity" and "minus infinity") are not real numbers. We use these symbols to indicate that the interval extends indefinitely in a direction.
    Notation Definition Graph Classification
    [ a , b ] { x |   a x b }
    Illustration for Intervals
    finite, closed
    ( a , b ) { x |   a < x < b }
    Illustration for Intervals
    finite, open
    [ a , b ) { x |   a x < b }
    Illustration for Intervals
    finite, half-open
    ( a , b ] { x |   a < x b }
    Illustration for Intervals
    finite, half-open
    [ a , ) { x |   a x < }
    Illustration for Intervals
    infinite, closed
    ( a , ) { x |   a < x < }
    Illustration for Intervals
    infinite, open
    ( , b ] { x |   < x b }
    Illustration for Intervals
    infinite, closed
    ( , b ) { x |   < x < b }
    Illustration for Intervals
    infinite, open
    ( , ) { x |   < x < } =
    Illustration for Intervals
    infinite, open and closed
    • Because intervals are sets, we can calculate the union, intersection, and difference of intervals. For example the set { x |   x 3 } can be written as ( , 3 ) ( 3 , ) or { 3 } . See the following figure.
    Illustration for Intervals
    Different ways to symbolically express the set shown above: { x |   x 3 }
    • To avoid any mistakes in set calculations on intervals, you can picture them graphically.
    Example 1.

    If I = [ 3 , 2 ) and J = ( 1 , 4 ) then find I J and I J .

    Solution

    The results are explained in the next two figures.

    Illustration for Intervals
    [ 3 , 2 ) ( 1 , 4 ) = [ 3 , 4 )

    and

    Illustration for Intervals
    [ 3 , 2 ) ( 1 , 4 ) = ( 1 , 2 ) .

    Exercises

    Exercise 1.

    Write each interval in set-builder notation and classify it as open, closed, or half-open.

    (a) [ 1 , 5 ]    (b) ( 0 , 7 )    (c) ( 2 , 3 ]    (d) [ 4 , )

    Answer

    (a) { x 1 x 5 } , closed   (b) { x 0 < x < 7 } , open   (c) { x 2 < x 3 } , half-open   (d) { x 4 x < } , closed

    Solution

    The rule to apply every time is the one stated in this section: a square bracket means the endpoint is included, and a parenthesis means it is excluded. An included endpoint gives ; an excluded one gives < .

    (a) [ 1 , 5 ] . Both brackets are square, so both endpoints belong:

    [ 1 , 5 ] = { x 1 x 5 } .

    Both endpoints included makes it a closed interval.

    (b) ( 0 , 7 ) . Both brackets are parentheses, so neither endpoint belongs:

    ( 0 , 7 ) = { x 0 < x < 7 } .

    Neither endpoint included makes it an open interval. Note that 0 itself is not in this set, though numbers as close to 0 as you like, such as 0.001 , are.

    (c) ( 2 , 3 ] . The left bracket is a parenthesis and the right one is square, so 2 is excluded and 3 is included:

    ( 2 , 3 ] = { x 2 < x 3 } .

    Exactly one endpoint included makes it half-open.

    (d) [ 4 , ) . The left bracket is square, so 4 belongs. On the right we have the symbol , and this section stresses that is not a real number — it merely records that the interval runs on for ever to the right. That is why a parenthesis is always used there. Following the table,

    [ 4 , ) = { x 4 x < } ,

    and the table classifies this as closed, since the only genuine endpoint, namely 4 , is included.

    A remark on notation that trips people up: ( 0 , 7 ) in part (b) looks exactly like the coordinates of a point in the plane. Only the surrounding context tells you which is meant. Some books avoid the clash by writing the open interval as ] 0 , 7 [ , a notation this section also mentions.

    Exercise 2.

    Write each set using interval notation.

    (a) { x 3 x < 6 }

    (b) { x x > 2 }

    (c) { x x 0 }

    (d)

    Answer

    (a) [ 3 , 6 )    (b) ( 2 , )    (c) ( , 0 ]    (d) ( , )

    Solution

    This is the previous exercise run backwards: now we read the inequality symbols and choose the brackets to match. A becomes a square bracket, a < becomes a parenthesis.

    (a) { x 3 x < 6 } . The left end is 3 with , so a square bracket. The right end is 6 with < , so a parenthesis:

    [ 3 , 6 ) .

    (b) { x x > 2 } . Only one endpoint is named. Since x is bigger than 2 , the set runs from 2 rightwards for ever, so the right end is . The inequality x > 2 is strict, so 2 is excluded and takes a parenthesis; always takes a parenthesis. Hence

    ( 2 , ) .

    Be careful to write the smaller end first. The notation always lists the left end before the right end, so ( , 2 ) would be wrong.

    (c) { x x 0 } . Now x is at most 0 , so the set runs leftwards for ever from 0 . The left end is , taking a parenthesis, and the right end is 0 with , taking a square bracket:

    ( , 0 ] .

    (d) . The set of all real numbers extends for ever in both directions, so both ends are infinite:

    ( , ) .

    The last row of the table in this section records exactly this, noting that { x < x < } = .

    A check worth doing on every answer of this type: name one number that should be in the set and one that should not, then test both against your interval. For (b), the number 5 should be in — and 5 does lie in ( 2 , ) . The number 2 should not be, since 2 > 2 is false — and correctly 2 is excluded by the parenthesis.

    Exercise 3.

    Say whether each statement is true or false.

    (a) 2 [ 2 , 5 )    (b) 5 [ 2 , 5 )    (c) 1 ( , 1 ]    (d) 0 ( 0 , )

    Answer

    (a) True   (b) False   (c) True   (d) False

    Solution

    Every part here turns on a single endpoint, so the bracket next to that endpoint decides the answer.

    (a) 2 [ 2 , 5 ) . The interval [ 2 , 5 ) is { x 2 x < 5 } . Test x = 2 : we need 2 2 , which is true because is satisfied by equality, and we need 2 < 5 , which is true. Both conditions hold, so the statement is true. The square bracket at the left end is what lets 2 in.

    (b) 5 [ 2 , 5 ) . Test x = 5 in { x 2 x < 5 } . The first condition, 2 5 , holds. The second condition, 5 < 5 , does not hold, since 5 is not strictly less than itself. So the statement is false. The parenthesis at the right end keeps 5 out.

    Parts (a) and (b) together make the point of the whole notation: [ 2 , 5 ) contains its left endpoint but not its right one, and you can tell which is which purely by looking at the brackets.

    (c) 1 ( , 1 ] . This interval is { x < x 1 } , that is, all numbers at most 1 . Test x = 1 : we need 1 1 , which holds by equality. So the statement is true. Do not be put off by the parenthesis on the left; that one sits next to and has nothing to say about 1 .

    (d) 0 ( 0 , ) . This interval is { x 0 < x < } , that is, all strictly positive numbers. Test x = 0 : we need 0 < 0 , which is false. So the statement is false.

    This case deserves a moment's thought. Every positive number, however small, lies in ( 0 , ) — including 0.1 , 0.001 , and 0.0000001 . Yet 0 itself does not. There is no "first" number in the interval, which is exactly what an open end means.

    Exercise 4.

    Let I = [ 4 , 1 ) and J = ( 1 , 3 ] . Find I J and I J .

    Answer

    I J = [ 4 , 3 ]    I J = ( 1 , 1 )

    Solution

    As this section advises, sketch the two intervals one above the other on a number line before doing anything else. Draw I running from 4 (filled dot, since it is included) to 1 (hollow dot, since it is excluded), and J running from 1 (hollow) to 3 (filled). The two overlap in the stretch between 1 and 1 .

    TikZ figure

    The union I J . The union collects every point lying in I or in J . Because the two intervals overlap, they merge into one unbroken stretch, running from the leftmost point of either to the rightmost point of either.

    • The left end is 4 , coming from I . It is included in I , so it is included in the union: square bracket.
    • The right end is 3 , coming from J . It is included in J , so it is included in the union: square bracket.
    I J = [ 4 , 3 ] .

    What about the endpoints 1 and 1 in the middle? They cause no trouble. The point 1 is missing from I , but it lies in J since 1 < 1 3 , so the union does contain it. Likewise 1 is missing from J but lies in I , so the union contains it. Each interval plugs the other's gap, which is why the answer has no holes.

    The intersection I J . The intersection keeps only the points lying in both, so we take the overlapping stretch. It runs from the larger of the two left ends to the smaller of the two right ends.

    • The left ends are 4 and 1 ; the larger is 1 . Since 1 is excluded from J , it cannot be in the intersection: parenthesis.
    • The right ends are 1 and 3 ; the smaller is 1 . Since 1 is excluded from I , it cannot be in the intersection: parenthesis.
    I J = ( 1 , 1 ) .

    The rule for endpoints in an intersection is strict: a point must be in both sets, so if either set leaves it out, the intersection leaves it out.

    Check with sample points. Take x = 0 . It lies in I , since 4 0 < 1 , and in J , since 1 < 0 3 . So it should be in both answers, and indeed 0 [ 4 , 3 ] and 0 ( 1 , 1 ) . Now take x = 2 . It lies in J but not in I , so it should be in the union but not the intersection — and indeed 2 [ 4 , 3 ] while 2 ( 1 , 1 ) .

    Exercise 5.

    Let I = [ 0 , 2 ) and J = ( 3 , 5 ] . Find I J and I J .

    Answer

    I J = [ 0 , 2 ) ( 3 , 5 ] , which cannot be written as a single interval.   I J =

    Solution

    Sketch the two intervals again. This time I stops at 2 and J does not begin until 3 , so there is a gap between them containing the numbers from 2 to 3 . The intervals do not touch at all.

    TikZ figure

    The intersection I J . A point in the intersection would have to satisfy both

    0 x < 2 and 3 < x 5.

    The first condition forces x < 2 and the second forces x > 3 . No number can be both smaller than 2 and larger than 3 , since that would require 3 < x < 2 , and there is no such number. So nothing qualifies, and

    I J = ,

    the empty set met in the earlier section on sets.

    The union I J . The union does exist — it simply consists of both pieces:

    I J = [ 0 , 2 ) ( 3 , 5 ] .

    The important point is that this cannot be simplified into a single interval. It is tempting to write [ 0 , 5 ] , but that would be wrong, because [ 0 , 5 ] contains numbers such as 2.5 that lie in neither I nor J . Test it: is 2.5 in I ? No, since 2.5 < 2 fails. Is 2.5 in J ? No, since 3 < 2.5 fails. So 2.5 has no business being in the union, and any single interval stretching from 0 to 5 would wrongly include it.

    Comparison with the previous exercise. There, the two intervals overlapped and the union collapsed into one interval. Here they are separated by a gap, and the union must be left as two pieces joined by . Whether a union of intervals simplifies depends entirely on whether the pieces meet — which is precisely why this section recommends drawing the picture first.

    Exercise 6.

    Find [ 0 , 6 ] ( 2 , 4 ) (sometimes written as [ 0 , 6 ] ( 2 , 4 ) ) and write the answer using interval notation.

    Answer

    [ 0 , 2 ] [ 4 , 6 ]

    Solution

    Recall the definition of set difference from the earlier section on sets: A B consists of the elements of A that are not in B . So we begin with the whole of [ 0 , 6 ] and cut out whatever belongs to ( 2 , 4 ) .

    What is being removed. The set ( 2 , 4 ) is { x 2 < x < 4 } . Both ends are open, so the numbers 2 and 4 themselves are not in it. Only the numbers strictly between them are removed.

    What survives. Take a point x in [ 0 , 6 ] and ask whether it is removed.

    • If 0 x 2 : such an x is not strictly greater than 2 , so it is not in ( 2 , 4 ) and it survives. Note that x = 2 survives, because 2 < 2 is false, so 2 was never in the removed set.
    • If 2 < x < 4 : this is exactly the removed set, so these points go.
    • If 4 x 6 : such an x is not strictly less than 4 , so it is not in ( 2 , 4 ) and it survives. Again x = 4 survives, since 4 < 4 is false.

    So what is left consists of two pieces, [ 0 , 2 ] and [ 4 , 6 ] :

    [ 0 , 6 ] ( 2 , 4 ) = [ 0 , 2 ] [ 4 , 6 ] . TikZ figure

    The point to be careful about. Because the interval removed was open, its endpoints 2 and 4 were never taken away, and they appear in the answer with square brackets. Students very often write [ 0 , 2 ) ( 4 , 6 ] here by reflex, excluding them. Always ask whether the endpoint actually belonged to the set being subtracted.

    To see the contrast, suppose we had been asked for [ 0 , 6 ] [ 2 , 4 ] instead, with a closed interval removed. Then 2 and 4 would be taken away, and the answer would be [ 0 , 2 ) ( 4 , 6 ] .

    Check. Test x = 2 : it lies in [ 0 , 6 ] , and it does not lie in ( 2 , 4 ) , so it should survive — and 2 [ 0 , 2 ] . Test x = 3 : it lies in [ 0 , 6 ] and also in ( 2 , 4 ) , so it should be removed — and 3 is in neither [ 0 , 2 ] nor [ 4 , 6 ] . Both checks agree.

    Exercise 7.

    Write each set using interval notation.

    (a) { x   | x 4 | < 3 }    (b) { x   | x | 2 }

    Answer

    (a) ( 1 , 7 )    (b) ( , 2 ] [ 2 , )

    Solution

    Each part needs two steps: first strip the absolute value bars using the properties of the previous section, then translate the resulting inequality into brackets.

    Part (a): | x 4 | < 3 .

    Property 7 form (i) of the previous section says | t | < r is equivalent to r < t < r when r > 0 . Here t = x 4 and r = 3 , which is positive, so

    3 < x 4 < 3.

    Add 4 to all three parts to leave x alone in the middle:

    3 + 4 < x < 3 + 4 , 1 < x < 7.

    Both inequalities are strict, so both endpoints are excluded and both brackets are parentheses:

    ( 1 , 7 ) .

    Read geometrically, this is the set of points within distance 3 of 4 — that is, the 3 -neighbourhood of 4 — which does indeed reach from 4 3 = 1 to 4 + 3 = 7 .

    Part (b): | x | 2 .

    Property 7 form (ii) says r | x | is equivalent to x r or r x . Here r = 2 , so

    x 2 or x 2.

    These are two separate conditions joined by or, so the set breaks into two pieces and we take their union.

    • x 2 runs leftwards for ever from 2 , with 2 included: ( , 2 ] .
    • x 2 runs rightwards for ever from 2 , with 2 included: [ 2 , ) .
    { x   | x | 2 } = ( , 2 ] [ 2 , ) .

    The contrast between the two parts. A "less than" condition on an absolute value traps x near the centre and gives one interval. A "greater than or equal" condition pushes x away from the centre in both directions and gives two intervals joined by . Trying to write part (b) as a single interval is impossible, since the numbers between 2 and 2 must be left out.

    Check. For (a), x = 6 gives | 6 4 | = 2 < 3 , so it belongs, and indeed 6 ( 1 , 7 ) ; x = 8 gives | 8 4 | = 4 , which is not less than 3 , and indeed 8 ( 1 , 7 ) . For (b), x = 5 gives | 5 | = 5 2 , and 5 ( , 2 ] ; x = 0 gives | 0 | = 0 , which is not at least 2 , and correctly 0 lies in neither piece.

    Exercise 8.

    Write the 0.5 -neighbourhood of 1 using interval notation.

    Answer

    ( 1.5 , 0.5 )

    Solution

    The previous section defines the δ -neighbourhood of a point a as the set of all points whose distance from a is less than δ :

    { x   | x a | < δ } = { x   a δ < x < a + δ } .

    Here the centre is a = 1 and the radius is δ = 0.5 .

    Working out the two ends. The left end is

    a δ = 1 0.5 = 1.5 ,

    and the right end is

    a + δ = 1 + 0.5 = 0.5 .

    Choosing the brackets. The definition of a neighbourhood uses a strict inequality, | x a | < δ , so points at distance exactly δ are not included. Both endpoints are therefore excluded and both brackets are parentheses:

    ( 1.5 , 0.5 ) .

    A neighbourhood is always an open interval, for exactly this reason.

    Check. Make sure the two ends are in the right order — the left one must be the smaller. Since 1.5 < 0.5 , they are. This is the step to watch with a negative centre, because subtracting the radius from a negative number moves further left, which can feel counter-intuitive.

    Test a point: x = 0.8 has distance | 0.8 ( 1 ) | = | 0.2 | = 0.2 from 1 , and 0.2 < 0.5 , so it should belong. Indeed 1.5 < 0.8 < 0.5 . Now test x = 0.4 : its distance is | 0.4 + 1 | = 0.6 , which is not less than 0.5 , so it should not belong, and correctly 0.4 > 0.5 .

    Exercise 9.

    A lift carries a load of w kilograms. It only operates when there is something inside, and it is rated for a maximum of 800 kg. Write the set of loads for which the lift operates, using interval notation, and say whether the interval is open, closed, or half-open.

    Answer

    ( 0 , 800 ] , half-open.

    Solution

    Translate each phrase of the problem into an inequality, paying close attention to whether the boundary value itself is allowed.

    "There is something inside." The load must be more than nothing, so

    w > 0.

    This is strict: a load of exactly 0 means the lift is empty, and we are told it does not operate then. So 0 is excluded.

    "Rated for a maximum of 800 kg." The word maximum means 800 is the largest permitted value, and a permitted value it is. So

    w 800 ,

    with 800 included.

    Putting them together. Both conditions must hold at once:

    0 < w 800.

    Now choose brackets. The left endpoint 0 is excluded, so a parenthesis; the right endpoint 800 is included, so a square bracket:

    ( 0 , 800 ] .

    Exactly one endpoint is included, so by the table in this section the interval is half-open.

    Why the endpoints deserve care. The whole difficulty in problems of this kind lies in two or three words. "Maximum of 800 ", "at most 800 ", and "no more than 800 " all include 800 . But "under 800 ", "less than 800 ", and "below 800 " exclude it. Reading past those words is the commonest source of error, and the difference is real: a load of exactly 800 kg either is or is not allowed.

    Check. A load of 800 kg should be allowed, and 800 ( 0 , 800 ] because of the square bracket. A load of 0 kg should not be, and 0 ( 0 , 800 ] because of the parenthesis. A load of 850 kg should not be, and indeed 850 > 800 .

    Exercise 10.

    A student writes { x x 3 } = ( , 3 ] [ 3 , ) . Find the error and give the correct answer.

    Answer

    The correct answer is ( , 3 ) ( 3 , ) .

    Solution

    The error. The student has used square brackets next to 3 . A square bracket means the endpoint is included, so the first piece ( , 3 ] contains 3 , and the second piece [ 3 , ) contains 3 as well.

    But the whole purpose of the set { x x 3 } is to leave 3 out. The student has written a set that not only fails to exclude 3 but includes it twice over.

    In fact the student's expression is the whole of . Every real number lies in one piece or the other: numbers less than 3 in the first, numbers greater than 3 in the second, and 3 itself in both. So instead of removing one point, the student's answer removes nothing at all.

    The correct answer. To exclude 3 , both brackets beside it must be parentheses:

    { x x 3 } = ( , 3 ) ( 3 , ) ,

    which is exactly the form given in this section. The first piece holds every number strictly below 3 and the second every number strictly above it, leaving a single point missing in between. The section also records the alternative way of writing the same set, { 3 } , using the set difference of the earlier section.

    How to catch this yourself. After writing an interval answer, test the boundary value against the original condition. Here the original says x 3 , so 3 must fail to belong. Substituting x = 3 into the student's answer shows it belongs — so the answer must be wrong. This single test takes a few seconds and catches almost every bracket mistake.

    Exercise 11.

    Explain why it is never correct to write an interval as [ 2 , ] .

    Solution

    The trouble is the square bracket next to .

    A square bracket has one specific meaning in this notation: the endpoint next to it is a number that belongs to the set. So [ 2 , ] would be claiming that is one of the elements of the set.

    But this section states plainly that and are not real numbers. They are symbols used to record that an interval runs on without stopping in a given direction. There is no point on the real number line called , so there is nothing there to include. Writing [ 2 , ] claims membership for something that does not exist as a number.

    Look at what the set-builder form would have to say. Following the pattern of the table, [ 2 , ] would mean

    { x 2 x } ,

    and the condition x is not a statement about real numbers at all, since compares numbers and is not one.

    The correct form. The interval of all numbers at least 2 is written

    [ 2 , ) ,

    with a square bracket on the left, because 2 is a genuine real number that does belong, and a parenthesis on the right, because there is no endpoint there to include. The table in this section still calls this interval closed, since its only real endpoint is included.

    The rule to remember. A parenthesis always sits next to and next to , without exception. So ( , 5 ] , ( 3 , ) and ( , ) are all correctly written, while [ , 5 ] and ( 3 , ] are not.

    Exercise 12.

    Is the following statement always true, sometimes true, or never true? "The union of two intervals is an interval." Justify your answer.

    Answer

    Sometimes true.

    Solution

    The answer is sometimes. We need one example where the union is an interval and one where it is not.

    Keep in mind the description given at the start of this section: an interval is the set of all real numbers lying between two given numbers, possibly including the ends. The key words are all the numbers in between — an interval is one unbroken stretch of the line with no gaps.

    A case where the union is an interval. Take [ 0 , 2 ] and [ 1 , 3 ] . These overlap, since the numbers from 1 to 2 belong to both. Pooling them gives every number from 0 to 3 with nothing missing:

    [ 0 , 2 ] [ 1 , 3 ] = [ 0 , 3 ] ,

    which is an interval.

    A case where the union is not an interval. Take [ 0 , 1 ] and [ 2 , 3 ] . These are separated by a gap. Their union is

    [ 0 , 1 ] [ 2 , 3 ] ,

    and this is not an interval. To see why, notice that 0 and 3 both belong to the set, but the number 1.5 , which lies between them, does not: it fails x 1 and it fails 2 x . An interval containing 0 and 3 would have to contain everything in between, and this set does not.

    Since both outcomes occur, the statement is sometimes true.

    What decides it. The union of two intervals is again an interval exactly when the two pieces meet or overlap, leaving no gap. This is the same distinction seen in earlier exercises: [ 4 , 1 ) and ( 1 , 3 ] overlapped and merged into [ 4 , 3 ] , while [ 0 , 2 ) and ( 3 , 5 ] were separated and had to be left as two pieces.

    A borderline case worth noticing. Consider [ 0 , 1 ) and [ 1 , 2 ] . They share no points at all, so their intersection is empty — yet their union is [ 0 , 2 ] , a perfectly good interval, because the first piece stops precisely where the second begins and the point 1 is supplied by the second. So overlapping is not required; what matters is that no gap is left.

    A contrast for interest. The corresponding statement about intersections behaves differently: the intersection of two intervals never has a gap in it, because a point missing from the middle would have to be missing from one of the two originals, and neither original has gaps.

    Exercise 13.

    Find the value of a for which [ a , 5 ] [ 1 , 7 ] = [ 2 , 5 ] , and explain why no other value works.

    Answer

    a = 2

    Solution

    Working out the intersection in general. A number x lies in [ a , 5 ] [ 1 , 7 ] exactly when it lies in both, that is, when

    a x 5 and 1 x 7.

    For x to clear both lower bounds it must be at least the larger of a and 1 . For it to stay under both upper bounds it must be at most the smaller of 5 and 7 , which is 5 . So the intersection runs from the larger of a and 1 up to 5 .

    Matching the required answer. We want the intersection to be [ 2 , 5 ] , so its left end must be 2 . The left end is the larger of a and 1 , so we need

    the larger of  a  and  1    to equal  2.

    Since 1 is not 2 , the larger of the two must be a itself, giving

    a = 2.

    Confirming it works. With a = 2 ,

    [ 2 , 5 ] [ 1 , 7 ] = [ 2 , 5 ] ,

    because [ 2 , 5 ] sits entirely inside [ 1 , 7 ] — every number between 2 and 5 is certainly between 1 and 7 . This matches the requirement.

    Why nothing else works. Test the other possibilities.

    • If a < 1 , say a = 0 : then the larger of a and 1 is 1 , so the intersection is [ 1 , 5 ] , not [ 2 , 5 ] . The number 1.5 would be in it but is not wanted. Any a below 1 gives the same answer [ 1 , 5 ] , since the bound 1 from the second interval takes over.
    • If 1 a < 2 , say a = 1.5 : the intersection is [ 1.5 , 5 ] , which again contains 1.5 and so is too big.
    • If a > 2 , say a = 3 : the intersection is [ 3 , 5 ] , which is missing the numbers from 2 up to 3 and so is too small.
    • If a > 5 : then no x can satisfy a x 5 at all, and the intersection is empty.

    Only a = 2 places the left end exactly where it is needed, so the value is unique.

    A remark on the method. The useful fact extracted along the way is worth remembering for future work: intersecting two intervals means taking the larger of the two left ends and the smaller of the two right ends. Drawing the two intervals one above the other, as this section recommends, makes this obvious at a glance.

    Frequently Asked Questions

    What is an interval?

    An interval is the set of all real numbers lying between two given numbers, which are called its endpoints. The endpoints may or may not be included, and the interval may extend without bound in one or both directions. Because an interval is a set of numbers, all the set operations apply to it: intervals can be unioned, intersected, and subtracted.


    When do I use a square bracket and when do I use a parenthesis?

    A square bracket means the endpoint is included, and a parenthesis means it is excluded. So [ 2 , 5 ] contains both 2 and 5 , while ( 2 , 5 ) contains neither, and [ 2 , 5 ) contains 2 but not 5 . The bracket matches in the corresponding inequality and the parenthesis matches < . Some texts write the open interval ( a , b ) as ] a , b [ instead, which avoids any clash with the notation for an ordered pair.


    Why does infinity always get a parenthesis and never a bracket?

    Because and are not real numbers. They are symbols indicating that the interval continues without end in that direction, so there is no endpoint there to include. Writing [ a , ] would claim that is a member of the set, which is meaningless. The correct forms are [ a , ) and ( , b ] , where the bracket, when present, applies only to the genuine numerical endpoint.


    What is the difference between an open and a closed interval?

    An open interval excludes both endpoints, a closed interval includes both, and a half-open interval includes exactly one. The distinction is not a technicality. The closed interval [ 0 , 1 ] has a largest element, namely 1 , while the open interval ( 0 , 1 ) has none, because whatever candidate you name there is always a larger number still below 1 . Note that ( , ) counts as both open and closed, since it has no endpoints to include or exclude.


    How do I take the union or the intersection of two intervals?

    Draw them one above the other on the same number line. The union is everything covered by at least one of them, and the intersection is the part covered by both. For the intersection there is a shortcut: keep the larger of the two left endpoints and the smaller of the two right endpoints. With I = [ 3 , 2 ) and J = ( 1 , 4 ) this gives I J = ( 1 , 2 ) , while the union is I J = [ 3 , 4 ) . Watch the bracket type at each surviving endpoint, since it comes from whichever interval supplied that endpoint.


    Is the union of two intervals always an interval?

    Only when they overlap or at least touch. The union [ 3 , 2 ) ( 1 , 4 ) = [ 3 , 4 ) is a single interval because the two pieces share the stretch from 1 to 2 . By contrast ( , 3 ) ( 3 , ) has a gap at 3 and is not an interval at all, merely a union of two of them. This is the standard way of writing the set { x x 3 } , which can equally well be written as { 3 } .


    How do I write "all numbers except 3" in interval notation?

    Split the line at the excluded point and take the union of the two remaining pieces:

    { x x 3 } = ( , 3 ) ( 3 , ) .

    Both endpoints at 3 take parentheses, which is exactly what removes the single point. The same idea handles domains of rational functions: to exclude both 0 and 2 , write ( , 0 ) ( 0 , 2 ) ( 2 , ) .