:

## Why doesn't my function definition work?

Here are two correct ways to define functions.
```
> f:=2-x;           One way is by assigning a formula to a name.
> plot(f,x=-1..1);  If you use this method you can refer to f,
> solve(f=0,x);     BUT referring to "f(x)" yields nonsense.
> f(x);      WRONG
2 - x(x)

> f:=x->x^2;          Another way is by using an arrow.
> f(x);               If you use this method you can refer to f(x),
> f(1);               BUT referring to just "f" only yields "f",
> plot(f(x),x=-1..1); not the function.
> solve(f(x)=0,x);
> f;         WRONG
f

```
Here is an INCORRECT way of defining a function.
```
> f(x):=2-x;        This assigns the formula to the name "f(x)",
but for f(1) and similar expressions Maple
just returns the same thing you type in.
```
Here is another INCORRECT way of defining a function.
```
> f=2-x;            This is an assertion rather than an assignment,
so it doesn't change the value of f at all,
and for f Maple will just return the name "f"
rather than 2-x.
```

﻿