Error, invalid input: too many and/or wrong type of arguments passed to f; first unused argument is 2*Pi - Maple Help

Home : Support : Online Help : Error, invalid input: too many and/or wrong type of arguments passed to f; first unused argument is 2*Pi

Error, invalid input: too many and/or wrong type of arguments passed to ...; first unused argument is ...

 Description This error is caused by incorrect arguments passed to a command. For correct syntax, see the help page for the command. You can use the type command to verify whether an argument is of the correct type required by the command.

Examples

Example 1

In the following example, attempting to sum more than one summand at a time results in an error.

 > $\mathrm{sum}\left({i}^{2},i,i\right)$

Solution:

To sum more than one summand at at time, use the map command.

 > $\mathrm{map}\left(\mathrm{sum},\left[{i}^{2},i\right],i\right)$
 $\left[\frac{{1}}{{3}}{}{{i}}^{{3}}{-}\frac{{1}}{{2}}{}{{i}}^{{2}}{+}\frac{{1}}{{6}}{}{i}{,}\frac{{1}}{{2}}{}{{i}}^{{2}}{-}\frac{{1}}{{2}}{}{i}\right]$ (2.1)

Example 2

In the following example, attempting to calculate the sum of over both index variables results in an error. This statement is not well-defined.

 > $\mathrm{sum}\left(i+j,i=1..3,j=6..8\right)$

Solution:

Depending on the interpretation, one possible solution is to express the sum in the following manner:  if the indices are meant to be sequenced individually, then the following statement corrects the error and produces the intended result.

 > $\mathrm{sum}\left(\mathrm{sum}\left(i+j,i=1..3\right),j=6..8\right)$
 ${81}$ (2.2)

Otherwise, if the indices are meant to be sequenced in tandem, then the following statement corrects the error and produces the intended result.

 > $\mathrm{sum}\left(\mathrm{eval}\left(i+j,j=i+5\right),i=1..3\right)$
 ${27}$ (2.3)

Example 3

The following example uses the solve command to solve a linear system, however the braces have been omitted around the list of expressions and the list of variables.

 >

Solution:

Enclosing the list of expressions and the list of variables in braces fixes the error.

 >
 $\left\{{x}{=}\frac{{1548}}{{3115}}{,}{y}{=}\frac{{3232}}{{623}}{,}{z}{=}{-}\frac{{2473}}{{3115}}\right\}$ (2.4)
 >