# Desmos

Desmos is a free online graphing calculator. Some classes at NCSSM require its usage, but it is a tool that any student of mathematics will appreciate. Here are enumerated some of the simple and complex functions of the software you might find useful. If this page is not sufficient, see the Desmos user guide for more information.

Below is a brief description of how to effectively use the Desmos online graphing calculator. Click the images to enlarge them.

## Graphing

### Functions

Simple functions of one variable can be graphed in three ways:

• Typing the equation (${\displaystyle x^{2}}$)
• Typing ${\displaystyle y=}$ and then the equation (${\displaystyle y=x^{3}}$)
• Typing ${\displaystyle f(x)=}$ and then the equation (${\displaystyle f(x)={\frac {x^{2}}{7}}}$)

Functions can be hidden from the graph by clicking the colored circle to the left of their equation.

Functions can be functions of other functions. For example:

• ${\displaystyle f(x)=x^{2}}$
• ${\displaystyle g(x)=f(x+1)}$

Functions can be graphed with x in terms of y: ${\displaystyle x={\sqrt {1-y^{2}}}}$

Functions can be of multiple variables. For example, ${\displaystyle g(a,b)=a^{2}+b}$ and ${\displaystyle h(a)=g(a,3)}$.

#### Parametric Equations

In Desmos you can graph parametric equations. The standard form of this is ${\displaystyle (f(t),g(t))}$. For example, ${\displaystyle (sin(2t),cos(3t))}$. It is necessary to use the variable ${\displaystyle t}$ in order for the equation to be interpreted as a parametric equation.

#### Implicit Functions

Solutions of equations involving x and y can be plotted without solving for x or y.

### Points and Tables

Points can be graphed in two ways. One way is by clicking the plus in the upper left, and then selecting table. Points can be added manually, or pasted in from an outside source, such as Logger Pro. The points will appear on the graph, but the viewport will not scale to accommodate them. To do this, see Resizing the viewport.

The other way to graph points is by adding them in the form ${\displaystyle (1,4)}$.

Movable points can be graphed by setting one or both of the parameters to variables: ${\displaystyle (1,g)}$. Movable points can be moved either with the sliders or by clicking and dragging the point. You can restrict a movable point to being on a function by graphing it in the form ${\displaystyle (a,f(a))}$.

You can add multiple points by separating them with commas, like so: ${\displaystyle (2,5),(3,10)}$. Points added this way cannot be accessed as a list of x and y values, unlike points in a table.

### Variables and Sliders

Sometimes, for example, when looking for the value of a constant or seeing how a function reacts to a change in one of its parts, it is useful to use a slider. Sliders represent a named variable.

To add a slider, write a function with a free variable, such as ${\displaystyle y=mx}$, then click on "add slider: m".

Another way to add variables is to type the variable letter, "=", and then a starting value. For example, ${\displaystyle d=100.42}$.

Clicking on either of the constraints of a slider allows you to set the minimum, maximum, and step values.

Performing regression analysis of data in Desmos is simple. First, enter the data points in a table as explained in Graphing Points.

Next, decide on the type of regression. If you want to do a linear regression, the equation would take the form ${\displaystyle y=mx+b}$. If you want a quadratic regression, the equation would look like ${\displaystyle y=ax^{2}+bx+c}$. The enterprising student can extrapolate this to any form they would like, such as ${\displaystyle y=e^{m}x+bx}$.

After you have decided the form your equation should take, substitute "${\displaystyle y}$" with "${\displaystyle y_{1}}$", "${\displaystyle x}$" with "${\displaystyle x_{1}}$", and "${\displaystyle =}$" with ${\displaystyle \sim }$. For example, to do a linear regression, you would enter ${\displaystyle y_{1}\sim mx_{1}+b}$. This is saying: "find the constant values m and b that best satisfy ${\displaystyle y=mx+b}$ for every ${\displaystyle x}$ and ${\displaystyle y}$ in my table, where ${\displaystyle x=x_{1}}$ and ${\displaystyle y=y_{1}}$". See the examples below for a demonstration.

Desmos will find the best constants that fit the points and function you put in. The value of each constant is shown under your function entry. As you can see, the function it finds is not always in the correct form. (This is because you provide the form, Desmos only finds the best values for the free variables that it can.) Above, the same points were used, but a line and a parabola were both found. The equation you get out is only as good as the equation form you put in.

One way to check whether the form of the function is correct is to plot the residuals, and see if there is a pattern. If you see a clear trend, such as the residuals moving in a straight line, parabola, or sinusoidal curve, you know you chose the wrong function to model your data, even if the r-value is small.

See Desmos regressions tour for an interactive demonstration for plotting regressions.

### Restrictions

It can be useful to restrict the domain or range of a function. To do this, add a restriction of the form ${\displaystyle \left\{2 directly onto the end of a function. This works with any variable: for a function of ${\displaystyle c}$ where c should be greater than 4, type ${\displaystyle \left\{c>4\right\}}$.

### Inequalities

Desmos also has the capability to graph inequalities. Simple inequalities are easy: type an expression followed by a comparison sign (e.g. ${\displaystyle <}$, ${\displaystyle >=}$) and then a value. For example, ${\displaystyle 3x<4}$. A slightly more complicated example might be ${\displaystyle x^{2}>y>2}$

You can also use this on functions you define. For example, say you're modeling compound interest, and want to set up an inequality for the space under the curve. To do this, define a function for amount given time, ${\displaystyle A(t)}$, and an inequality ${\displaystyle 0. Notice the use of ${\displaystyle x}$ instead of ${\displaystyle t}$. Desmos is picky about variables, and for inequalities it implicitly defines x and y as the input and output.

We can use this powerful tool in tandem with restrictions. To graph the area between functions ${\displaystyle f(x)}$ and ${\displaystyle g(x)}$, all we have to do is type ${\displaystyle f\left(x\right)y>f\left(x\right)\right\}}$.

## Built-in Functions and Symbols

Desmos comes with many built in functions and symbols. Here are some of the documented and undocumented ones. Most of these can be accessed by opening the keyboard and clicking "functions".

### Variables

Input Result Explanation
theta ${\displaystyle \theta }$ A variable, like ${\displaystyle x}$.

### Constants

Input Result Explanation
pi ${\displaystyle \pi }$ The constant 3.14...
tau ${\displaystyle \tau }$ The constant 6.28...
e ${\displaystyle e}$ The constant 2.71...

### Exponent and Log Functions

Input Result Explanation
exp(x) exp(x) ${\displaystyle e^{x}}$
ln(x) ln(x) The natural log of x
log(x) log(x) The log (base 10) of x
log_n(x) ${\displaystyle log_{n}(x)}$ The log (base n) of x
x^n ${\displaystyle x^{n}}$ x to the nth power
sqrtx ${\displaystyle {\sqrt {x}}}$ The square root of x
nthrootx ${\displaystyle {\sqrt[{n}]{x}}}$ The generalized root function.

### Precalculus and Calculus Functions

Input Result Explanation
sum ${\displaystyle \sum _{n=}}$ The summation operator
prod ${\displaystyle \prod _{n=}}$ The product operator.
int ${\displaystyle \int }$ The integral operator.
d/dx ${\displaystyle {\frac {d}{dx}}}$ The differential operator. Can be used on functions.

### Trig Functions

 sin(x) arcsin(x) or ${\displaystyle sin^{-1}(x)}$ sinh(x) cos(x) arccos(x) or ${\displaystyle cos^{-1}(x)}$ cosh(x) tan(x) arctan(x) or ${\displaystyle tan^{-1}(x)}$ tanh(x) sec(x) arcsec(x) or ${\displaystyle sec^{-1}(x)}$ sech(x) csc(x) arccsc(x) or ${\displaystyle csc^{-1}(x)}$ csch(x) cot(x) arccot(x) or ${\displaystyle cot^{-1}(x)}$ coth(x)

### Stats and Probability Functions

Function Explanation
total(${\displaystyle x_{1}}$) Sum of all elements in a list
length(${\displaystyle x_{1}}$) Number of elements in a list
mean(${\displaystyle x_{1}}$) Mean of a list
median(${\displaystyle x_{1}}$) Median element in a list
min(${\displaystyle x_{1}}$) Minimum element in a list
max(${\displaystyle x_{1}}$) Maximum element in a list
quantile(${\displaystyle x_{1},p}$) The quantile function
mad(${\displaystyle x_{1}}$) Mean absolute deviation
stdev(${\displaystyle x_{1}}$) Sample standard deviation
stdevp(${\displaystyle x_{1}}$) Population standard deviation
var(${\displaystyle x_{1}}$) Variance
cov(${\displaystyle x_{1},x_{2}}$) Covariance
corr(${\displaystyle x_{1},x_{2}}$) Pearson correlation coefficient of two lists
nCr(${\displaystyle n,r}$) Number of combinations
nPr(${\displaystyle n,r}$) Number of permutations
${\displaystyle x!}$ Factorial

### Miscellaneous Functions

Input Explanation
lcm(a,b) The least common multiple of a and b
gcd(a,b) The greatest common denominator of a and b
mod(a, b) The modulo function
ceil(x) The closest integer above x
floor(x) The closest integer below x
round(x) The closest integer to x
sign(x) The sign of x
abs(x) The absolute value function
${\displaystyle |x|}$ The absolute value operator
a%b a percent of b

## Making graphs easier to read

### Resizing the viewport

The viewport (the section of the coordinate plane visible onscreen) can be resized to give a better view of your data and functions. One way to resize it is to scroll down to zoom out, and up to zoom in, and to click and drag to move. This method, however, keeps the ratio of the domain and range constant. Sometimes it is useful to be able to zoom to an arbitrary window.

To do this, click the wrench in the top right corner (graph settings). After this, a window will appear. In this window, there are inequalities for ${\displaystyle x}$ and ${\displaystyle y}$ (${\displaystyle a\leq x\leq b}$ and ${\displaystyle c\leq y\leq d}$) which can be edited to resize the viewport with the domain set by ${\displaystyle x}$ and range set by ${\displaystyle y}$.

### Changing line colors/styles

If you have many functions graphed, it can be useful to change their appearance. To do this, perform a long left click on the icon to the left of the function definition. From here, you may change the style to dashed, dotted, or unbroken, and the color to one of six options.

### Projector mode

When saving images for reports or projects, it can be useful to have thicker, fuller lines and larger text. To enable this, go to graph settings and enable "Projector Mode".