Understanding Curves and Surfaces in Math with Maxima

Understanding Curves in the Plane

Implicit (F(x,y) = 0) / Explicit: z = F(x,y) / Parametric: X(u,v), Y(u,v), Z(u,v)

Explicit Curve

define(F(x),(x-1)/(2*x^2+1))

Represent:

  • wxdraw2d(explicit(F(x),x,-3,3))
  • wxdraw2d(color=red,explicit(F(x),x,-3,3), xrange=[-4,4], yrange=[-1.5,0.5], xaxis=true, yaxis=true, title="Example")

Implicit Curve

define(G(x,y),x^2+y^2-1)

Represent:

  • wxdraw2d(implicit(G(x,y),x,-1,1,y,-1,1))
  • wxdraw2d(color=red, implicit(G(x,y),x,-1,1,y,-1,1), xrange=[-1.5,1.5], yrange=[-1.5,1.5], proportional_axes=xy, xaxis=true, yaxis=true, title="Implicit Example")

Explicit and Implicit Representation

wxdraw2d(color=red, implicit(G(x,y),x,-1,1,y,-1,1), color=blue, (explicit(F(x),x,-3,3)), proportional_axes=xy, xaxis=true, yaxis=true, title=...)

Parametric Curve

define(xt(t),t+sin(t))

define(yt(t),cos(t))

wxdraw2d(color=red, parametric(xt(t),yt(t),t,0,3*%pi), xaxis=true, yaxis=true, proportional_axes=xy)

Drawing Regions

define(Jcir(x,y),x^2+y^2-4)

define(Hrec(x,y),x+y-2)

Represent:

wxdraw2d(color=blue, implicit(Jcir(x,y)=0,x,-2,2,y,-2,2), color=green, implicit(Hrec(x,y)=0,x,-3,3,y,-3,3), fill_color=red, x_voxel=40,y_voxel=40, region(Jcir(x,y)<=0 and Hrec(x,y)>=0,x,-2,2,y,-2,2), proportional_axes=xy, xaxis=true, yaxis=true)

Absolute Extrema

Define the function and the regions. Always to the left, move everything:

define(f(x,y),(x+1)^2+y^2)

define(cir(x,y),(x+3)^2+y^2-16)

define(par(x,y),y^2-2*x-14)

Draw Region

wxdraw2d(fill_color=light_green, region(cir(x,y)<=0 and par(x,y)>=0,x,-8,2,y,-5,5), color=red, line_width=2, implicit(cir(x,y),x,-8,2,y,-5,5), color=blue, implicit(par(x,y),x,-8,2,y,-5,5), color=black, explicit(0,x,-8,2), implicit(x=0,x,-8,2,y,-5,5), dimensions=[500,500])

Critical Points of the Function

define(fx(x,y),diff(f(x,y),x))

define(fy(x,y),diff(f(x,y),y))

solve([fx(x,y)=0,fy(x,y)=0],[x,y])

Intersection Vertices

solve([cir(x,y)=0,par(x,y)=0],[x,y])

Critical Points of Each Region

define(L(x,y,a),f(x,y)+a*cir(x,y))

define(Lx(x,y,a),diff(L(x,y,a),x))

define(Ly(x,y,a),diff(L(x,y,a),y))

solve([Lx(x,y,a)=0,Ly(x,y,a)=0,cir(x,y)=0],[x,y,a])

Evaluate the points that coincide within the region in the function.

Surfaces in Space

Explicit Surface

define(F(x,y),x*y^2/2)

wxdraw3d(explicit(F(x,y),x,-5,5,y,-5,5))

wxdraw3d(enhanced3d=true, explicit(F(x,y),x,-5,5,y,-5,5), xlabel="OX", ylabel="OY", zlabel="OZ", view=[55,35], dimensions=[600,600])

Level Curves

wxdraw3d(explicit(F(x,y),x,-5,5,y,-5,5), xlabel="OX", ylabel="OY", contour=map, contour_levels={1,2,5,7,8}, dimensions=[600,600])

Implicit Surface

define(G(x,y,z),(x-1)^2-(y-1)^2+z^2-1)

wxdraw3d(implicit(G(x,y,z),x,-5,5,y,-5,5,z,-5,5))

wxdraw3d(enhanced3d=true, implicit(G(x,y,z),x,-5,5,y,-5,5,z,-5,5), xlabel="OX", ylabel="OY", zlabel="OZ", view=[75,35], dimensions=[600,600])

wxdraw3d(implicit(G(x,y,z),x,-5,5,y,-5,5,z,-5,5), contour=base, contour_levels={0,1,2}, dimensions=[600,600])

Parametric Surface

define(Xuv(u,v),(1+v*sin(u))*cos(2*u))

define(Yuv(u,v),(1+v*sin(u))*sin(2*u))

define(Zuv(u,v),v*cos(u))

wxdraw3d(enhanced3d=true, parametric_surface(Xuv(u,v),Yuv(u,v),Zuv(u,v),u,2,2*%pi,v,-0.5,0.5), xlabel="OX", ylabel="OY", zlabel="OZ", view=[50,60], dimensions=[600,600])

With Level Curve:

wxdraw3d(parametric_surface(Xuv(u,v),Yuv(u,v),Zuv(u,v),u,2,2*%pi,v,-0.5,0.5), contour=base, contour_levels={-4,0,4})

Parametric Surface with Parametric Curves

wxdraw3d(color=dark_green, parametric_surface(Xuv(u,v),Yuv(u,v),Zuv(u,v),u,2,2*%pi,v,-0.5,0.5), color=red, parametric(Xuv(%pi/2,v),Yuv(%pi/2,v),Zuv(%pi/2,v),v,-0.5,0), color=blue, parametric(Xuv(u,0),Yuv(u,0),Zuv(u,0),u,0,2*%pi), xlabel="OX", ylabel="OY", zlabel="OZ", view=[50,55], dimensions=[600,400])

Parametric Curve in Space

define(Xt(t),2*cos(t))

define(Yt(t),3*sin(t))

define(Zt(t),t/4)

Represent:

wxdraw3d(color=dark_green, nticks=100, parametric(Xt(t),Yt(t),Zt(t),t,0,8*%pi), xlabel="OX", ylabel="OY", zlabel="OZ", view=[50,55], dimensions=[600,400])