Skip to main content
edited tags
Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Post Migrated Here from math.stackexchange.com (revisions)
Source Link

Mathematica: Extract the piece that contains x=0 from within a piecewise function

In mathematica, I have a piecewise function similar to:

Piecewise[{ {x^2 + 2*x - 4, 0 <= x <= 1/4},
            {0, true}                    }]

I don't know how many pieces there will be, or what the internal ordering will look like, but I know that exactly one of the pieces will have x=0 as its left endpoint. How do I extract that piece in its general form (x^2 + 2*x - 4) without knowing the upper end of its domain (1/4)?