# Domain and Range Restrictions

To limit the domain or range (x or y values of a graph), you can add the restriction to the end of your equation in curly brackets {}. For example, y=2x{1<x<3} would graph the line y=2x for x values between 1 and 3.

You can also use restrictions on the range of a function and any defined parameter.

It's also possible to add multiple restrictions to the same expression line regardless of what parameter is being restricted.

12 out of 15 found this helpful
Have more questions? Submit a request

Can I restrict the domain to integers?

• Vicente Jiménez

Hi,

No problem with the use of restrictions in the domain or range, but how do you type "not equal?

• 8365494

How do you put a range restriction that includes an "or"?

• Isaac Parlin

I have the same question as 8365494. How can you add an "or" to your restriction?

For example, is there any way I could create a line, and then effectively erase intermittent segments of it by adding multiple domain restrictions using "or"?

• Leena M

Hello,

Is it possible to use interval notation for restricting the domain and range? My pre-calc teacher prefers we use interval notation but I'm not sure if that's possible for a Desmos drawing.

• Ryan Walden

I would like to use mod in the domain of my equation.

ie.

f(x)=x+1 {mod(x,3)=0, 0<x<=6}

the graph should have the following outputs

(3,4) (6,7)

instead I get a graph for f(x)=x+1 {0<x<=6}

can I not use mod in my domain or is this a syntax error on my part?

• Jason Bell

A couple people were asking how to write a restriction with "or". I was also wondering about this, but couldn't find an answer anywhere. However, I happened to discover that using a comma seems to do the trick. For example, if you only want the upper and lower part of the line y = 2x + 1, you can use the restriction {x<-2, x>1}. (Notice the comma). Hope this helps someone.

• Daniel S

It should appear as a triangle, but instead says that one side of the inequality must be a polynomial. I only have this problem when restricting domain AND range. How can I fix this?

• James Zickmantel

How to limit the dot.
https://www.desmos.com/calculator/y7wsjj7l1n
I put c as the animated driver instead of b which is defined as c but with curly brackets you add the greater then less than rule
Hope that's what you were asking!?

• battle fir

Desmos is simply amazing !!!! I really appreciate everything that you have done for making math fun!

But please just tell me how to make the upper bound of the integral as +ve infinity??

I have observed that Desmos is capable of calculating the sum of curves extending to infinity in the y-axis. So I believe that it would be possible to calculate the area of curves that extend in both directions of the x-axis.

I have a link to the graph describing my problem:

https://www.desmos.com/calculator/z6paruk0xd

Edited by battle fir
• Daniel Cheng

Basically, I have a parabola and I set it as an inequality so that anything less than it is shaded. Then, I set a restriction to limit the amount (x and y) shaded.

• Ahedman

Bhavna Sivakumar

Make sure the argument of your function is the same as the domain restriction. Since your function is a function of "t", change your restriction to {0<t<3.5}.

• Bnichols

• Sc Mccallis

Is it possible to limit x values to strictly intergers? I have a function where it should not be possible for rational numbers to be placed within the equation, which is xcos(180x-360/2x), in which x cannot be rational, cannot be less than 3 and cannot be negative. I know for the less than three i need to use {x<3} and for the negative i need to use {y>0}, however i cannot figure out how to limit the x values to intergers only.

• James Zickmantel
• Orion D. Hunter
• James Zickmantel

I think I get it but it doesn't explain well the function of colons and commas in this example:

{f(x)>0:0,f(x)<0:f(x)}<y<{f(x)>0:f(x),f(x)<0:0}{a<x<b,b<x<a}

The colon is some kind of 'if-else' expression and the comma is for chaining of multiple conditions.

Edit: here is something about it called piecewise

https://support.desmos.com/hc/en-us/articles/203192385-Piecewise

Edited by James Zickmantel
• Foura Brahim

Hello
I wish to restrict the domain only to integers, is it possible with the actual implementation of Desmos ?

• Ahedman

Hey Velascri,

Think about it this way: you only want to plot the parts of the ears that are "above" the places where the circles intersect. You can limit the part of the equation that graphs by using curly brackets {} after the equation. For example, the following entry will be graphed as the line y=2x, but only for values of x greater than 1.

y = 2x {x>1}

With that said, think of where you want to graph your lines: only above the places where the circles intersect. The word "above" should be a clue that you want your y values to be greater than something. If you use a constant value like {y>5}, desmos will graph the top half of each circle. If you use an expression with x, like {y > x + 12}, desmos will graph whatever part of the circle for which the y value of the point is 12 more than the x value of the point, which is good for the left ear, though it's not perfect. You could get it to be perfect by finding both intersections of the left ear and the head, then using the inequality that corresponds to the equation for the line that passes through those two points. I think the following two entries will work well for you:

(x+8)^2+(y-5)^2<= 15  {y>x+12 }

(x-8)^2+(y-5)^2 <= 15 {y>-x+12}

For less than or equal, use "<="

• Velascri

I have an assignment in my algebra class to create a picture on a graph with desmos - I'm trying to make a panda and am having trouble making the ears because I want the circles for the ears to be jutting out from the head rather than connected to it at one point. With this, I have to adjust the domain and range of the ear circles to exclude the part of it that is inside the head circle. How do I do this?

The equations for the circles are as follows

Head circle - x^2 + 1.5y^2 = 100

Ear circles - (x + 8)^2 + (x - 5)^2 < 15, (x - 8)^2 + (x - 5)^2 < 15 (it's supposed to be less than or equal to, I just don't know how to type that)

• Ahedman

Ryan,

For some reason the desmos engine doesn't do mod(x,3)=0, perhaps it's graphing an "infinately" small point. If you allow the value of the modular function to be less than a small number, say, mod(x,3)<0.01, then you will see the points you expect. As for the second restriction, commas are interpreted as "or", so desmos is graphing values that the mod is zero OR x is between 0 and 6. To use an "and", you need to use a pair of brackets for each restriction. The fucntion below should give you what you're looking for.

f(x)=\left(x+1\right)\left\{\operatorname{mod}(x,3)<0.01\right\}\left\{0<x<6\right\}

Edited by Ahedman
• James Zickmantel

Not sure if this does what you hoped. Let me know either way.
https://www.desmos.com/calculator/ka09s97va1

There is no infinity symbol though, so use the largest number as that is the limit of the systrm/language that it can calculate. It would nice but I guess it's not feasible at this time.

Edited by James Zickmantel
• Daniel Cheng

The functions on lines 30 and 32 of the following graph show up up close, but when you zoom out, it just disappears.

https://www.desmos.com/calculator/jr97a6dxvy

Does anyone have a solution to this?

• Dan Meyer

How does it work though?

• Noah Meyer

How do you use unions with the restrictions?

• silver

I have a circle that needs to have a restriction at 5 and -5 on the y axis and -10 on the x

So far I have:

(x-h)^2+(y-k)^2=r^2

k=0

r=5

h=-10

does any one have a solution?

• Ahedman

Kazi Abu Rousan,

Use the floor function, which rounds the argument down to the next integer.  "floor(x)" gives only the integral part of x.

• Bhavna Sivakumar

Hi, I am graphing multiple conditional piece wise functions to see their correlation and trying to write its restrictions but when I use the {} brackets it is forming a line, how should I write the restrictions?

Function: 95(.87)^t    ... Restriction: {0<x<3.5}

Edited by Bhavna Sivakumar
• Dario Chaiquin

How do you state multiple restrictions in one set of curly brackets?

• O19 Dittgavi

I used quite a bit of this information in my quest to create a halo 3 killjoy medal in desmos. Feel free to look for yourself! https://www.desmos.com/calculator/hn1ydbadfr