# Limit usage for Plot3D [duplicate]

Suppose I need to plot a function $z = x^2 - y^2$ using a 3 dimensional surface plot (Plot3D feature). Assume the $x$ limit for this plot is [x_min, x_max] and y limit is [y_min, y_max]. In my case, x_max is a function of co-ordinate y. How do I incorporate this in the Plot3D command ?

Eg. Plot3D[x^2-y^2, {xlim, x_min, x_max(y)}, {ylim, y_min, y_max}] does not work.

There can be dependency in the limits, the trick is to order the independent variables first:

Plot3D[x^2 - y^2, {y, 0, 1}, {x, 0, y^3}]


Plot3D[x^2 - y^2,
{x, 0, 2}, {y, 0, 2},
RegionFunction -> Function[{x, y}, 0 < x < y^3 + 4 && 0 < y < 2]]


Here, the upper limit of the region is explicit in 0 < x < y^3 + 4.

• I am sorry but I didn't understand how we are using the upper limit of x here as a function of y. Say x_max = y^3 + 4. How do we incorporate that using your method. – Astronomer Mar 28 '17 at 20:33
• Equivalently, you can give a region as a plotting domain: Plot3D[x^2 - y^2, {x, y} ∈ ImplicitRegion[0 < x < y^3 + 4 && 0 < y < 2, {x, y}]] – J. M.'s discontentment Mar 29 '17 at 1:40