I am trying to plot a hyperboloid in two sheets using Mathematica. I tried solving for z when x^2/a^2 + y^2/b^2 - z^2/c^2 = 1 and then using that equation for my f1 and f2, but the graph just ends up being blank.

'''f1 = (c*sqrt[-a^2b^2+x^2b^2+y^2a^2])/(ab)

f2 = (c*sqrt[-a^2b^2+x^2b^2+y^2a^2])/(ab)

Manipulate[Plot3D[{f1, f2}, {x, -100, 100}, {y, -100, 100}], {a, -100, 100}, {b, -100, 100}, {c, -100, 100}]'''

New contributor
RoseBuddy is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1


Functions are case-sensitive in Mathematica. Therefore, sqrt[] is not recognized; it must be Sqrt[] to invoke the built-in square root function.

Multiplication of terms requires either the usage of the infix operator * or the use of a space between the terms, so the product $ab$ is written as a * b or a b.

In a more general vein, it is not necessary to plot the sheets separately via Plot3D. An alternative approach is to use ContourPlot3D as follows:

Manipulate[ContourPlot3D[x^2/a^2 + y^2/b^2 - z^2/c^2 == -1, {x, -100, 100}, {y, -100, 100}, {z, -100, 100}], {a, -100, 100}, {b, -100, 100}, {c, -100, 100}]

It is also worth noting that the hyperboloid has one sheet for your particular equation $$\frac{x^2}{a^2} + \frac{y^2}{b^2} - \frac{z^2}{c^2} = 1.$$ It will have two sheets if the RHS is $-1$: $$\frac{x^2}{a^2} + \frac{y^2}{b^2} - \frac{z^2}{c^2} = -1.$$

You can observe this by solving for $z$ in each. In the first case, $$z = \pm c^2 \sqrt{\frac{x^2}{a^2} + \frac{y^2}{b^2} - 1}.$$ This would suggest that the surface does not contain any points inside the elliptical cylinder $$\frac{x^2}{a^2} + \frac{y^2}{b^2} < 1,$$ and implies that this cannot be a hyperboloid of two sheets. In the second case, $$z = \pm c^2 \sqrt{\frac{x^2}{a^2} + \frac{y^2}{b^2} + 1},$$ which by virtue of the fact that the square of a real number is never negative, shows that $z$ is always defined for any $(x,y) \in \mathbb R^2$, thus there are two distinct surfaces depending on the choice of sign.


Not the answer you're looking for? Browse other questions tagged or ask your own question.