# Plot of a function defined on a differentiabl manifold

I'm following a course of Math and I would like to have a Plot of a 3D function defined over a CountorPlot. I used the command of 'Plot3D' to define the domain of a function but the region where the function f is defined is a differential manifold. There is an example:

f:3 x^2 - 2 y

manifold: x^3 - 3 x^2 y + y^2 - 1 == 0

I tried to visualize the intersection between the graphs using this code:

  aaa = ContourPlot3D[
x^3 - 3 x^2 y + y^2 - 1 == 0, {x, -10, 10}, {y, -10, 10}, {z, -10,
10}, PlotPoints -> 100]

bbb = Plot3D[ 3 x^2 - 2 y, {x, -10, 10}, {y, -10, 10},
PlotPoints -> 100]

Show[aaa, bbb]


use Mesh and MeshFunctions tricks.

f = 3 x^2 - 2 y;
g = x^3 - 3 x^2 y + y^2 - 1;
Plot3D[f, {x, -10, 10}, {y, -10, 10}, PlotPoints -> 100,
MeshFunctions -> Function[{x, y, z}, g], Mesh -> {{0}},
MeshStyle -> Directive[Thickness[Large], Red], PlotStyle -> None] Combining your original approach with that of cvgmt

Clear["Global*"]

f = 3 x^2 - 2 y;
g = x^3 - 3 x^2 y + y^2 - 1;

Legended[
Show[
ContourPlot3D[g == 0,
{x, -10, 10}, {y, -10, 10}, {z, -10, 10},
PlotPoints -> 100,
ContourStyle -> Opacity[0.5, Blue]],
Plot3D[f,
{x, -10, 10}, {y, -10, 10},
PlotPoints -> 100,
PlotStyle -> Opacity[0.5, Green],
MeshFunctions ->
Function[{x, y, z}, g],
Mesh -> {{0}},
MeshStyle -> {Red, Thick}]],
SwatchLegend[
{Opacity[0.5, Green], Opacity[0.5, Blue], Red},
{"f", "g==0", "Intersection"}]]
` 