FuncApplication
FuncApplication
FuncApplication[ f, a ] evaluates a function or mapping for an input value.
Usages
FuncApplication[ x->expr, a ] or f[ a ]
FuncApplication[ x->expr, a ] substitutes a for x in expr. If a script variable f is defined as a mapping, f[a] gives the same result as FuncApplication[f, a]. The result is not calculated; use Simplify for that.
| Example | in | out |
|---|---|---|
Substitute 4 in x^2+3x. |
FuncApplication[ x->x^2+3x, 4 ] |
4^2+3*4 |
Calculate the result with Simplify. |
Simplify[ FuncApplication[ x->x^2+3x, 4 ] ] |
28 |
| A mapping stored in a script variable. | f := t -> t^2 |
r = 3^2 |
| A mapping and an input stored in script variables. | f := t -> Sin[t] |
r = Sin[Pi] |
| A mapping with two variables: give the values as a list. | FuncApplication[ {x,y}->x+y, {1, 2} ] |
1+2 |
| A function name. | FuncApplication[ Sqrt, 9 ] |
Sqrt[9] |
FuncApplication[ list, i ]
If the first argument is a list, FuncApplication[ list, i ] returns the element at position i (starting at 1).
| Example | in | out |
|---|---|---|
| The second element. | FuncApplication[ {a, b, c}, 2 ] |
b |
Note
FuncApplication does not currently support evaluating variables for intermediate parts in the Algebrakit CMS.
Details
- Display:
FuncApplication[ f, x ]is displayed as , for example in a definition or an answer. - A constant as the first argument is returned unchanged:
FuncApplication[ 5, 2 ]gives5.
| Invalid input | Result |
|---|---|
FuncApplication[ {a, b, c}, 5 ] |
Left unevaluated: the position is outside the list. |
FuncApplication[ g, 2 ] (g not defined) |
Left unevaluated. |
See also: Map, Apply, Substitute, Simplify