When Desmos looks at your third expression, it sees something like (ignoring a lot):

Mathematically speaking, this would be bad notation, so Desmos throws an error. The developers put a lot of thought into balancing expectations of math teachers/students and programmers/computer scientists (c.f. Logs and Infinities), and I think they made the right call here.

You can make use of the `total()`

function to get the result you want:

You can't do that because you're defining `f(x,y)`

twice.

First let's understand the difference between 2 kinds of Desmos statements: **Equations** and **Function Definitions**.

These are all **equations**:

```
y = 1
y = x
y = x ^ 2 - x + 14
x ^ 2 + y ^ 2 = 1
x + y = 1
x / y = y / x
sin(x) = e^y
```

They're all relationships between `x`

and `y`

. Desmos can and will always plot equations as long as they only use `x`

and `y`

as variables.

These are **function definitions**:

```
f(x) = x
g(x) = x ^ 2 - 2 * x + 1
D(j) = j ^ j
C(y) = e ^ y
h(x, y) = x + y - x * y
```

They're like equations, but instead of typing `y`

we give the equation a name, e.g. `f(x)`

and then define it. The first 4 functions take one parameter, so they can be transformed to an equation and **will be plotted**:

```
f(x) = x //y = x
g(x) = x ^ 2 - 2 * x + 1 //y = x ^ 2 - 2 * x + 1
D(j) = j ^ j //y = x ^ x
C(y) = e ^ y //y = e ^ x
```

However the last one takes *two* parameters, so it **can't** be plotted on the plane.

Now back to the question, try doing this:

```
f(x, y) = 1
f(x, y) = x ^ 2 + y ^ 2
f(0, 0)
```

The last line will throw an error:

You've defined 'f' in more than one place. Try picking a different variable, or deleting some of the definitions of 'f'.

And that's exactly the issue, you defined the function `f(x, y)`

in two spots, so Desmos can't tell which one to use to resolve your inquiry.

In the second example, you define `f(x)`

once and `g(x)`

once, and then you tell Desmos to plot the equation `f(x) + g(x)`

which is basically `y = f(x) + g(x) = x ^ 2 + x ^ 3`

.

Another thing is, your `f(x, y)`

function takes two parameters so it'll **never** be plotted even if it was correctly defined once, because it's 3 dimensional but Desmos is in 2D.

For example:

```
f(x, y) = 3 x ^ 2 + x * y - 1
```

This function will be defined successfully without throwing, but won't be plotted because it's 3 dimensional. You can only plot one 2 dimensional 'slice' of it at a time:

```
g(x) = f(x,0)
```

This will plot.

## Best Answer

From Change Color or Style (UNTESTED - I think you would need to be signed in, or click on Edit List (the gear icon) first):