# How to plot the following function?

Say I have a function

f(x,y,theta,xi) = x*y*c*theta*xi;


where c is a function of theta and xi and is predefined as

c:=theta*xi+theta^xi^2;


so f is effectively a function of x, y, theta, xi.

when I do the

Plot3D[f[x,y,0.5,0.5],{x,0,1},{y,0,1}]


Mathematica could not automatically calculate the value of c.

How do I plot a function of this sort?

That is, it contains a parameter which is a expression of the variables.

Thank you.

• It's not clear how you defined f. How it is done will affect how it works. Probably, the global variable theta in the definition of c is not the same as the local parameter theta in the definition of f. – Michael E2 Jan 30 '16 at 18:44

Make c an explicit function of theta and xi

c[theta_, xi_] = theta*xi + theta^xi^2;

f[x_, y_, theta_, xi_] = x*y*c[theta, xi]*theta*xi;

Plot3D[f[x, y, 0.5, 0.5],
{x, 0, 1}, {y, 0, 1}]


• Hi Bob, thanks for your code. But when I run it, it gives "Tag Times in (theta\ xi)[theta_,xi_] is Protected."I understand that it is because I am passing a function to another function. – LazyGamer Jan 30 '16 at 20:50
• Could you please share your thought on how to overcome this problem- tag times is protected" in general? thanks! – LazyGamer Jan 30 '16 at 20:51
• @LazyGamer - The code as posted works. Clear all of your definitions or start with a fresh kernel. – Bob Hanlon Jan 31 '16 at 0:05