# The UnitStep function and Intervals

For the input

UnitStep[Interval[{-4, 5}]]


I get

Interval[{0, 1}]


Why is this not Interval[{0,0}, {1,1}]?

-
Because it is Listable (see Attributes@UnitStep) and can deal with real-valued intervals. This information can be easily found in documentation pages. – Artes Nov 3 '13 at 14:30
I understand that, but your comment is suggesting an answer to my question: UnitStep is merely threading itself over the Interval, and doesn't "know" that it's an Interval that could result in a tighter interval result? Is that correct? – payne Nov 3 '13 at 15:23
@MichaelE2 What do you mean by incorrect interval? UnitStep[Interval[{-Pi, Pi}]] yields Interval[{0, 1}], similarly Sin[Interval[{-Pi, Pi}]] yields Interval[{-1, 1}]. What is your problem? – Artes Nov 3 '13 at 17:11
@Artes Isn't the range of UnitStep just the set {0, 1}? I thought that's what Interval[{0, 0}, {1, 1}] represents. Perhaps, I'm wrong, but that's how I understood it. Interval[{0,1}] represents all reals between 0 and 1. That's incorrect. – Michael E2 Nov 3 '13 at 17:23
@Artes I don't think Listable has anything to do with the problem. Tan[Interval[{1, 2}]] returns disjoint intervals Interval[{-Infinity, Tan[2]}, {Tan[1], Infinity}]. If UnitStep worked correctly with Interval, UnitStep[Interval[{a, b}]] would return the range of values of UnitStep over that interval, either Interval[{0,0}], Interval[{1,1}], or Interval[{0,0}, {1,1}] depending on the signs of a and b. – Michael E2 Nov 3 '13 at 17:55

I think there is a bug with Interval. What I find for this moment:

$$\begin{array} {c|c|c|c} \text{Function} & \text{Interval} & \text{Result} & \text{Should be}\\ \hline \text{UnitStep} & [-4,5] & [0,1] & [0,0],[1,1]\\ \text{Sign} & [0,1] & [-1,1] & [0,0],[1,1]\\ \text{Round} & [0,2] & [0,2] & [0,0],[1,1],[2,2]\\ \text{Floor} & [0,2] & [0,2] & [0,0],[1,1],[2,2]\\ \text{Ceiling} & [0,2] & [0,2] & [0,0],[1,1],[2,2]\\ \end{array}$$

Also almost all polynomials are working incorrectly

ChebyshevT[3, Interval[{-1, 1}]

Interval[{-7, 7}]


It is well known that the Chebyshev polynomials of the first kind $T_n(x)$ have values from $-1$ to $1$ if $-1\le x \le 1$.

 Plot[ChebyshevT[3, x], {x, -1, 1}]


The problem is that the polynomials are expanded first

ChebyshevT[3, x]

-3 x + 4 x^3


And then Interval[{-1, 1}] is substituted

-3 Interval[{-1, 1}] + 4 Interval[{-1, 1}]^3

Interval[{-7, 7}]

-