How to put a function in Desmos

Updated November 2026 · Sarkari Tools math team

Quick answer

To put a function in Desmos, type its name, the input in brackets, an equals sign and the formula: f(x) = x² − 4. Desmos graphs it straight away and remembers the name for later.

f(x)=x^2-4f(3)y=f(x-2)+1g(x)=2x+1

Step by step

  1. Click the first expression line and type f(x)=x^2-4.
  2. To find a value, type f(3) on a new line. Desmos shows 5.
  3. To graph a transformation, type y=f(x-2)+1, which shifts f right 2 and up 1.
  4. Define a second function, g(x)=2x+1, then combine them: f(g(x)) or f(x)+g(x).
  5. Use other names if you like: h(t), p(n) and so on.

Try it live

This graph is drawn by our free graphing calculator, which uses the same style of typing. Edit any line and the graph updates.

drag to pan · scroll to zoom

Common mistakes and tips

  • Use * or a space for multiplication when it could be confused with a function name.
  • Exponents need ^. Type x^2, not x2.
  • Use brackets for functions like sin: sin(x), not sin x.

Frequently asked questions

How do I graph y = f(x) after defining f?

Defining f(x) already draws it. To draw a changed version, type y = f(…) with the change.

How do I find f(x) for many values at once?

Make a table with x₁ values and type f(x₁) as the second column’s header.

Can I define a function of two variables?

Yes, for example f(x,y)=x²+y², and use it in equations such as f(x,y)=9.

No Desmos? Use our free online graphing calculator

Our free online graphing calculator works in any browser with no sign-up, and it shows step-by-step working where it can.

More Desmos guides

Desmos is a trademark of Desmos Studio PBC. Sarkari Tools is independent and not affiliated with or endorsed by Desmos. Our guides describe how to use the Desmos calculator; our own calculators are separate tools.