inequality with a piecewise function

Niek Sprakel shared this question 4 years ago
Answered

Hi.

When I use inequalities with piecewise functions, I get some unexpected results.

For instance here:

https://i.imgur.com/OHpXRWS.png

I have two piecewise-defined functions that are very similar (the only difference is that the two pieces are swapped).

But when I use an inequality statement, only one of the two piecewise-defined functions can be used to shade an area. Why doesn't that work with the other inequality?


Also, if a nested if statement for a piecewise-defined function can be used to shade an area with an inequality, it seems that an equivalent if statement that isn't nested can't be used in the same fashion to obtain a shaded area.

https://i.imgur.com/y5bAKM1.png


greetings and thanks in advance for any feedback on this issue, Niek

Best Answer
photo

You need to make sure both arguments of If() are functions, thus:

h(x) = If(x < 1, cos(x), 2 + 0x)

Comments (3)

photo
1

piecewise functions are not named in

https://wiki.geogebra.org/e...

I do not get any area with your not nested syntax

the no nested syntax is newest. I hope the issue is solved soon

photo
1

You need to make sure both arguments of If() are functions, thus:

h(x) = If(x < 1, cos(x), 2 + 0x)

photo
1

sorry, not enough


f(x) = If(x < -1, x, -1 ≤ x, x²)
a: y < f(x)
does not work


g(x) = If(x < -1, x, -1 < x < 1, x², -x)
b: y < g(x)
does not work


g(x) = If(x < -1, x, If(-1 < x < 1, x², -x))
b: y < g(x)
works

© 2023 International GeoGebra Institute