Linked Questions

5
votes
3answers
10k views

Passing a function as an argument of another function [duplicate]

Possible Duplicate: Pass function or formula as function parameter I am trying to implement a simple Plot[]-like function, with the same synopsis; my first (and unique so far) try would be ...
8
votes
4answers
297 views

Identify the independent variable in an expression [duplicate]

Suppose that you write something like this for your students. This is just the beginning of something I would like to write to help them with the formal definition of a limit, but I am puzzled by the ...
9
votes
2answers
384 views

Duplicate the swap function

Because defining the function: swap[x_, y_] := Module[{}, t = x; x = y; y = t; Return[]] and writing: swap[x, y] {x, y} I ...
7
votes
3answers
334 views

Get unevaluated option value?

This is kind of a follow-up to this question. I want to be able to define a function that takes an option, and then, inside the function, retrieve and test the unevaluated value of the option. For ...
3
votes
2answers
131 views

Why does this function fail when a non-function version of the same code works?

This works: ...
1
vote
1answer
73 views

Implementing a function so it accepts functions, function names and expressions as an argument

I'm trying to write a Mathematica function which takes an arbitrary expression as input. More concretely, I'm trying to write an integration function (utilizing the trapezoidal method), the input of ...
0
votes
2answers
94 views

Supply a function as an argument to another, and find its minimum

I would like to minimize a function, which is supplied as an argument to another function, and report back the estimates of the values of the variables that result in its minimum. In specific, I would ...
1
vote
1answer
94 views

User-defined density plotting function with a functional argument: extracting variables from the function and plotting in a circular region

I would like to customize the function DensityPlot and use it in a package as a function called MyDensityPlot: The functions ...
0
votes
1answer
43 views

Locally (de)assigning a value

I have failed in adapt the methods discussed in $\qquad$Pass function or formula as function parameter to my work. I would like to know if there is a way to say the following to Mathematica: If <...
0
votes
0answers
38 views

Imitate Integrate's behavior with regard to the integrand parameter (scoping/naming)

Using Integrate, I can do any of the following: ...