How do you restrict the domain in Geogebra?

Chucky13 shared this question 13 years ago
Answered

Hi, Can i please get some help here. I've been trying for hours to try and find a way to restrict the domain of some functions i input. Is there an easy way to do this in geogebra?

Comments (15)

photo
3

Hi, Can i please get some help here. I've been trying for hours to try and find a way to restrict the domain of some functions i input. Is there an easy way to do this in geogebra?


Hallo,

you tried for hours? Do you know the "Help" menu?

From ggb help menu:

    Function


    Function[Function, Number a, Number b]: Yields a function graph, that is equal to f on the interval [a, b] and not defined outside of [a, b].


    Note: This command should be used only in order to display functions in a certain interval.

Regards Abakus

photo
3

This is great. Thank you. I have been unable to restrict the domain of a horizontal function (y= constant). Is there a special command, like with vertical lines.

Thanks

photo
3

try with

f(x) = If(<fromX> < x < <toX>, 0x + <constantY>)

photo
4

try, if you want, x² with xϵN

(c,c²), it will create a slider, and activate the trail to that slider

photo
1

Oh Rami, thank you.

I was getting mad with the message "function must depend on x".

photo
photo
1

Thank you, this was exactly what i needed.

photo
1

Besides Function[], there is If[].

Function


Function[Function, Number a, Number b]: Yields a function graph, that is equal to f on the interval [a, b] and not defined outside of [a, b].


Note: This command should be used only in order to display functions in a certain interval.

and

Conditional Functions


You can use the Boolean command If in order to create a conditional function.


Note: You can use derivatives and integrals of such functions and intersect conditional functions like “normal” functions.


Examples:


f(x) = If[x < 3, sin(x), x^2] gives you a function that equals sin(x) for

x < 3 and x2 for x ≥ 3.

You can use either one although at various times one could be superior to the other. I am still learning that part.


Tony

photo
1

Hi Chucky13!


It's good to point out that the restriction given by "Function[]" doesn't work when the function is used to define others functions. From the GeoGebra 3.2 Online Help:


f(x) = Function[x^2, -1, 1] gives you the graph of function x^2 in the interval [-1, 1]. If you then type in g(x) = 2 f(x) you will get the function g(x) = 2 x^2, but this function is not restricted to the interval [-1, 1].


Best regards, Humberto.

photo
1

Hello there;


Is this helpful for constructing piecewise functions too?

I tried to get the one sided limit of f(x)=If(x<1,-x+3,x≟1,3,x>1,x^(2)-4x+4) from the right at x=1, but it seems it didn't work.

Link to the corresponding worksheet is behind:


https://ggbm.at/kDT6CYzX


Maybe its outcome isn't actually a function.

photo
2

I think there is a little bug, I get answer only when f has two pieces

photo
1

Yes. When I removed the single valued piece it worked.

I hope the team behind GeoGebra find a workaround soon.

photo
1

How would you do this on the online graphing calculator?

photo
1

if(-1<x<=2,x,2<x,4-x^2) for instance

or

a(x, y) = If(x⁴ - x² ≤ y ≤ x² - x⁴ ∨ y⁴ - y² ≤ x ≤ y² - y⁴, x² + y²)

c(x, y) = If((abs(x) - 0.2)² + (abs(y) - 0.2)² ≤ 0.1, 2x² + 2y²) for 3Dgraphics

photo
photo
3

What do you do if you want only positive x-values?


In other programs it's very easy: f(x) = 2x, x > 0

photo
2

I just found out (version 6) that the easiest way (for me) is:


f(x) := 3x, 0 < x < 10

© 2023 International GeoGebra Institute