Given a transcendental equation $F * exp [x] + x * y + sqrt[F-y] = 0$, is there a way for Mathematica to automatically 3D-plot F[x,y]
depending on x
and y
?
$\begingroup$
$\endgroup$
$\begingroup$
$\endgroup$
The simplest method would be just
ContourPlot3D[F Exp[x] + x y + Sqrt[F - y] == 0, {x, -2, 2}, {y, -2, 2}, {F, -2, 2}]
Unfortunately there are some problems because the Sqrt
term is complex sometimes. A better plot is obtained by squaring the equation and using RegionFunction
to eliminate the extra solutions:
ContourPlot3D[(F Exp[x] + x y)^2 == F - y, {x, -2, 2}, {y, -2, 2}, {F, -2, 2},
RegionFunction -> Function[{x, y, F}, F Exp[x] + x y < 0]]
$\begingroup$
$\endgroup$
Not a great deal. First you solve it:
sl = Solve[F*Exp[x] + x*y + Sqrt[F - y] == 0, F]
(* {{F -> 1/2 E^(-2 x) (1 - 2 E^x x y - Sqrt[
1 - 4 E^(2 x) y - 4 E^x x y])}, {F ->
1/2 E^(-2 x) (1 - 2 E^x x y + Sqrt[1 - 4 E^(2 x) y - 4 E^x x y])}} *)
and then plot:
Plot3D[{sl[[1, 1, 2]], sl[[2, 1, 2]]}, {x, -1, 1}, {y, -1, 1},
PlotStyle -> {Blue, Orange}]
and should see this:
Have fun!
-
$\begingroup$ Try evaluating
F*Exp[x] + x*y + Sqrt[F - y] /. sl /. {x -> -1, y -> -1}
: neither "solution" satisfies the original equation. $\endgroup$ – user484 Jan 13 '16 at 16:42
F
in terms of elementary functions, as shown by @Kuba. $\endgroup$ – march Jan 13 '16 at 16:10