# How do I plot an implicit function? [closed]

I want to plot the implicitly defined function $$u(x,\,t)=(x - u(x,\,t)\, t)^2$$. How can I do that?

• What does ut mean? – Kuba Sep 10 '20 at 11:08
• ut means u(x,t)*t, (value of function times t) – Von Sep 10 '20 at 11:11
• Have you seen the documentation for ContourPlot? – Marius Ladegård Meyer Sep 10 '20 at 11:21
• I am reading it right now, but i still don't know to implement nested part. – Von Sep 10 '20 at 11:28
• You can solve for u. Rearrange the equation as Solve[x^2 + u (-1 - 2 t x + t^2 u) == 0, u] and you have two solutions u1[x_,t_] := (1 + 2 t x - Sqrt[1 + 4 t x])/(2 t^2) and u2[x_,t_]:=(1 + 2 t x + Sqrt[1 + 4 t x])/(2 t^2) – flinty Sep 10 '20 at 11:34

Yes, we regard u[x,t] as a implicit function which define by the equation u=(x-u*t)^2. So we can use ContourPlot3D to draw the relations between the three variables x,t,u

ContourPlot3D[u == (x - u*t)^2, {x, -5, 5}, {t, -5, 5}, {u, -5, 5},
Mesh -> None, PlotPoints -> 60, AxesLabel -> {x, t, u},
AxesStyle -> Directive[{Blue, FontFamily -> "Times", 15}]] • Okey, what if i wanted to make countourplot of function u? (not 3d, i mean 2d one, countour lines of fuction u(x,t).) Just inserting ContourPlot[u == (x - u*t)^2, {x, -5, 5}, {t, -5, 5}, {u, -5, 5}] doesnt seem to work. – Von Sep 10 '20 at 12:43
• @Von One way is project to x-t plane. ContourPlot3D[u == (x - u*t)^2, {x, -5, 5}, {t, -5, 5}, {u, -5, 5}, MeshFunctions -> (#3 &), Mesh -> 50, PlotPoints -> 60, AxesLabel -> {x, t, u}, ContourStyle -> None, AxesStyle -> Directive[{Blue, FontFamily -> "Times", 15}], ViewProjection -> "Orthographic"] /. {Graphics3D -> Graphics, {x_Real, t_Real, u_Real} -> {x, t}} – cvgmt Sep 10 '20 at 13:28

For the 2D contour plots

Clear["Global*"]

eqn = u[x, t] == (x - u[x, t]*t)^2;

sol = Solve[eqn, u[x, t]] // Simplify

(* {{u[x, t] -> (1 + 2 t x - Sqrt[1 + 4 t x])/(2 t^2)}, {u[x, t] -> (
1 + 2 t x + Sqrt[1 + 4 t x])/(2 t^2)}} *)


Verifying the solutions,

eqn /. sol // Simplify

(* {True, True} *)

Column[
ContourPlot[#, {x, -4, 4}, {t, -4, 4},
PlotLegends -> Automatic,
ImageSize -> Medium,
FrameLabel -> Automatic,
PlotPoints -> 50,
PlotLabel -> Style[StringForm["", #], Bold, 14]] & /@
(u[x, t] /. sol)]
` 