Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Examples for Multivariable Calculus

Project: MATH 331
Views: 647
var('w', 'x', 'y', 'z') f(x, y) = x^2 + y^2 t = pi / 3 a = 2 b = 1 fx(x, y) = f(x, y).derivative(x) fy(x, y) = f(x, y).derivative(y) S = plot3d(f(x,y), (x, -3, 3), (y, -3, 3), color = 'blue', opacity = 0.5) P = parametric_plot3d([a + w*cos(t), b + w*sin(t), z], (w, -3, 3), (z, 0, 10), color = 'red', opacity = 0.5) C = parametric_plot3d([a + w*cos(t), b + w*sin(t), f(a + w*cos(t), b + w*sin(t))], (w, -3, 3), color = 'black') T = parametric_plot3d([a + w*cos(t), b + w*sin(t), f(a, b) + w*(fx(a, b)*cos(t) + fy(a, b)*sin(t))], (w, -3, 3), color = 'black') show(S + P + C + T, aspect_ratio = [1, 1, 0.5])
(w, x, y, z)
3D rendering not yet implemented
f(x, y) = x^3 - y^3 C = contour_plot(f(x, y), (x, -2, 2), (y, -2, 2), contours = 20) G = plot_vector_field(f.gradient(), (x, -2, 2), (y, -2, 2)) show(C + G)
# 63 var('r', 't', 'u', 'v') S1 = parametric_plot3d([r*cos(t), r*sin(t), r^2], (r, 0, 0.7), (t, 0, 2*pi), color = 'blue', opacity = 0.5) S2 = parametric_plot3d([(2/3)*sin(u)*cos(v), (1/3)*sin(u)*sin(v), (1/3)*cos(u)], (u, 0, pi), (v, 0, 2*pi), color = 'green', opacity = 0.5) show(S1 + S2)