Error: ... expects its ... argument, ..., to be of type ..., but received ...

This error is produced when an argument to a function or command is not of the type that it is designed to be. The function may be part of Maple itself, or one that you wrote (using :: to specify the type required). If the function is part of Maple, look at its help page, in particular the "Calling sequence" and "Parameters" sections, to see the correct way to use it. Examine the argument that cause the trouble. In some cases it is helpful to use the whattype command to see what type this argument actually has.

One common way that this error occurs is if you specify the independent variable in dsolve as y instead of y(x) .


> f:= (x::integer) -> x^2+1;

> f(q);

Error, f expects its 1st argument, x, to be of type integer, but received q

> dsolve(D(y)(x) = y(x), y);

Error, (in dsolve) dsolve/inputck1 expects its 2nd argument, vars, to be of type {list, set, function}, but received y

See also: Declaring the type of an argument , type , dsolve , whattype

Maple Advisor Database R. Israel 1997