# Finding and plotting solutions of a complex function

I have a complex function given by

f1 = Sqrt[-16 x^4 - 16 y^4 - 16 z^4 - 32 I x^3 \[Pi] + 24 x^2 \[Pi]^2 + 8 I x \[Pi]^3 - \[Pi]^4]


When I plot the real part of this function using

Plot3D[{Re@f1 /. {z -> 0}, 0}, {x, -3, 3}, {y, -3, 3}]


I get

I see that there are $$(x,y)$$ at which Re[f1]==0. However, when I try to plot these points separately using

ContourPlot3D[Re@f1 == 0, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}, MeshFunctions -> {#3 &}, Mesh -> {{0}}, PlotPoints -> 100, PlotRange -> All, ContourStyle -> None, BoundaryStyle -> None,  Boxed -> False]


The output is empty! I have checked these threads and also these ones but couldn't figure out why the ContourPlot3D does not generate the correct results. Do you have any suggestions?

• The surface only touchs z==0 , Contourplot cannot detect these kind of contours! Jun 14, 2022 at 7:48

Maybe there only several lines which ContourPlot3D can not handle.

f1 = Sqrt[-16 x^4 - 16 y^4 - 16 z^4 - 32 I x^3 π +
24 x^2 π^2 + 8 I x π^3 - π^4]; sol =
Reduce[{Re@f1 == 0 /. {z -> 0}, x ∈ Reals,
y ∈ Reals}, {x, y}]
reg = Region[Style[ImplicitRegion[sol, {x, y}], Red], PlotRange -> 10,
Axes -> True,
AxesLabel -> {Style["x", Bold, Blue, 14],
Style["y", Bold, Blue, 14]}]


Show[Plot3D[{Re@f1 /. {z -> 0}, 0}, {x, -3, 3}, {y, -3, 3},
Mesh -> None, Boxed -> False, Axes -> False, PlotPoints -> 50,
MaxRecursion -> 2]
, Graphics3D[{Red, AbsoluteThickness[5],
MeshPrimitives[DiscretizeRegion[reg, PlotRange -> 10],
1] /. {{x_Real, y_Real} :> {x, y, 0}}}]]


• This is what I was looking for. Thanks a lot! Jun 14, 2022 at 9:04
• Do you have any suggestion to also plot this result in 3D? Jun 14, 2022 at 9:27
• @Shasa See the updated, It is OK now. Jun 14, 2022 at 9:50
• Wonderful! Thank you very much. Jun 14, 2022 at 9:59

ContourPlot (Mathematica v12.2) cannot handle contour z==0 because it's onesided.

pic = Plot3D[{Re@f1 /. {z -> 0}, 0}, {x, -3, 3}, {y, -3, 3} ,Mesh -> None]


RegionPlot3D for small region Re@f1 < .5 might help to illustrate

Show[{pic, RegionPlot3D[Re@f1 < .5, {x, -3, 3}, {y, -3, 3}, {z, -3, 3},PlotPoints -> 100  , PlotStyle -> Red, Mesh -> None]}]


• (+1)Thanks for your answer and comment. Jun 14, 2022 at 14:56