Items tagged with function

For a function of one variable, I use the map command quite a bit to evaluate the function at several values of the independent variable. For example,




How may I do something similar for a function of two variables? For example,



Can the map command be used to evaluate f at each ordered pair? Maybe I'm not even using the correct data structure. Thanks!

my function is:

f := proc (x) if 0 < x and x < evalf(Pi) then 1 elif evalf(Pi) < x and x < evalf(2*Pi) then -1 end if end proc

now it tried:

f1 := add((-1)^n*f(x-evalf(2*n*Pi)), n = 0 .. 10)

to get a periodic function.

but unfortunately it says:

Error, (in f) cannot determine if this expression is true or false: 0 < x and x < 3.141592654
already when trying to calc the sum.

Good afternoon everybody,

I have a problem with the evaluation of a function. You can see the test programm I have written to test the use of functions and in the end I don't get values but the expression in letters.
I think the problem lies in the definition of g but I don't know how to solve the problem.

Thank you for your help,





I'm trying to add the output of my function FunctionToTree,which gets all elements from an expression, to a graph using the Graph function but I'm getting erros even when I add it as a list.

local elem;
local Tree:=NULL;
local exprType := convert(whattype(expr),string);
local newExpr:=convert(expr,string);
if (nops(expr) <> 1) or (nops(op(1,expr)) <> 1) then
for elem in op(expr) do :


Presently, I am trying to find a way to replace functional expressions by a variable 

For example I have an expression as follows:

p:=f(x)^2 + g(x)^3 

I would like to get this to look like 

q:= f^2 + g^3 

Does anybody have an idea of how to do this in Maple? 



Hello, I have a problem in plotting the vector field of dx/dt=sinx/sint

It shows me an error:

Error, (in DEtools/dfieldplot) unable to evaluate function `sin(x)` in evalhf

Dunno how to fix it

Here is my code:

DE := [diff(x(t), t) = sin(x)(t)/sin(t)];
dfieldplot(DE, x(t), t = -2 .. 2, x = -1 .. 2, arrows = medium, title = 'Diff', color = DC);

Hello everybody,


I'm completely new to Maple (installed it today) and have a question about the use of multi variabele expressions. I wanted to use a function B depending from the variables a, b, c and d without describing the expression explicit. 

For example: B:= (a, b, c, d);            [without the -> a....]

Then I wanted to take the taylor expansion of the first order for [a=e, b=f, c=g, d=h...

i am implementing q-Laplace

when there are quite many differentiation rules

how to do a function for a new kind differentiation like a maple do?


Is it possible to plot WKB solutions such as exp(-I*f(x)*x)/sqrt(f(x); where f(x) is any generic function of x e.g. sin^2x ? I have been trying in maple but can't get it to give me a plot.

I dont know what to do any further...

I have some function containing HeunG as a function

it is of the following form

f(k)=argument(functions containing HeunG) - ln(2)*k

now plotting this works...

But when differentiating with respect to k and then plotting it gives me the following message:

Warning, expecting only range variable k in expression (I*((1/2)^(1/2*I*k))^2*HeunG(3,-9/2+3/4*I*k-3/4*k^2,-1+1/2*I*k,-1/2+1/2*I*k,1/2,1+I*k,1/2...



I wrote a Maple 15 worksheet containing a function that calls two other functions defined earlier in the worksheet.  The main function didn't work, so I replaced one of the functions that was called, by cut-and-pasting its definition into the main function.  This is obviously inconvenient because I want to alter the function that I cut-and -pasted and whenever I do it I will have to cut-and-paste again.  It also detracts from the...


I have created a test document to check an equation and I would like to feed a range of k values (ranging from 0 to say 512) in increments of 1) to the main function, and then plot the result as a graph of Zuncomp (y-axis) vs k(x-axis).

I can verify the values of the function by typing say Zuncomp(0) or Zuncomp(10) etc but how do you run this so that you do Zuncomp(k) to read all values of k and generate the output to plot?

Using Maple 13 (Windows 7...


In trying to solve:

 a := diff(u(t), t$2)+(p^2-I+t^2)*u(t) = 0;
I get the following solutions,              
sol1 := u(t) = _C1*WhittakerM(-1/4-(1/4*I)*p^2, 1/4, I*t^2)/sqrt(t)+_C2*WhittakerW(-1/4-(1/4*I)*p^2, 1/4, I*t^2)/sqrt(t)        
It should be possible to expand these into parabolic cylinder functions and but im not sure how, i would appreciate any help.

Hi everyone,


I am trying to understand how can I create a function based on the differentiate of a matrix.


For instance:

And I would like to create the matrix FF based on the derivative of F with respect to x and then be able to use FF and a function.

I tried to combine, unapply, map and diff but I can't reach what I'm looking for.


I want to create a tangent function.

I know that you can create tan(x) but how can you create the tangent function when the solutions are only:

x in [0.19740;0.91510[ union [3.3390;4.0567 ?


Another explanation:

How you can graphically show the valid values of x in this inequality?

                  0.2 ≤ tan x < 1.3
Best regards
First 12 13 14 15 16 17 18 Last Page 14 of 27