# Finding tangent to intersection of two surfaces

In $$\mathbb{R}^3$$ we have two surfaces as follows:

$$f(x,y,z)= x^2 + y^2 -2 = 0 ~~~(cone)$$ $$g(x,y,z) = x+z-4 = 0 ~~~ (plane)$$

We want to find the tangent line to the intersection of these two surfaces in a point $$(x_0 , y_0 , z_o)$$ that lies on both surfaces.

What I do is that I find $$\nabla f \ (x_0 , y_0 , z_0)$$ and $$\nabla g \ (x_0 , y_0 , z_0)$$ and then calculate $$\nabla f \times \nabla g$$. For this example I checked it for $$(1,1,3)$$ and it gave me $$(2,-2,-2)$$ which is actually $$\frac{1}{\sqrt 3}(1,-1,-1)$$ and it is right.

Does this hold for every situation where we have two equations of two surfaces? Is this because gradient is perpendicular to surface?

• $x^2 + y^2 = 2$ is a cylinder, I believe. – XRFXLP Jun 26 '19 at 12:51

Yes, that's (almost) correct. I say "almost" because it's possible to have a pair of surfaces that intersect nicely, but for which one or both gradients is zero. The correct statement is not that the gradient of the defining function is perpendicular to the surface, but rather that for every tangent vector $$v$$ to the surface, $$\langle v , \nabla f (x_0, y_0, z_0) \rangle = 0$$; those are almost identical, unless the gradient is zero. If it's zero, we don't generally say that it's "perpendicular to the surface". (Also: at places where the gradient is zero, it's possible that the solution-set to your equation is not "surface-like" -- it might have a corner or be otherwise degenerate.)
Consider $$x^2 + y^2 + z^2 = 1$$ and $$x = 0$$, at the point $$(0, 1, 0)$$; if you do your computations as before, everything works out perfectly.
But now consider $$x^2 + y^2 + z^2 = 1$$ and $$\color{red}{x^2} = 0$$ (which is exactly the same pair of surfaces) at the point $$(0, 1, 0)$$; if you do your computations as before, the gradient of the second function, $$f(x, y, z) = x^2$$, is $$(0,0,0)$$ at the point $$(0,1,0)$$, hence doesn't yield the direction vector for the tangent line that you're seeking.