# 미분적분학실습2-참고자료

## 1294 days ago by jhlee2chn

15.6. Parametric Surfaces and Their Areas

Ex. 1

var('u, v') r = vector([2*cos(u), v, 2*sin(u)]) parametric_plot3d(r, (u, 0, 2*pi), (v, -3, 3), opacity = 0.4)
 Sleeping...

Ex. 2

var('u, v') r = vector([(2 + sin(v))*cos(u), (2 + sin(v))*sin(u), u + cos(v)]) parametric_plot3d(r, (u, 0, 4*pi), (v, 0, 2*pi), opacity = 0.4, mesh = True)
 Sleeping...

Ex. 4

var('t, p') r = vector([2*sin(p)*cos(t), 2*sin(p)*sin(t), 2*cos(p)]) parametric_plot3d(r, (t, 0, 2*pi), (p, 0, pi), opacity = 0.4, mesh =True)
 Sleeping...

Ex. 5

var('t, z') r = vector([2*cos(t), 2*sin(t), z]) parametric_plot3d(r, (t, 0, 2*pi), (z, 0, 1), opacity = 0.4, mesh =True)
 Sleeping...

Ex. 7

var('x, y') r = vector([x, y, 2*sqrt(x^2 + y^2)]) parametric_plot3d(r, (x, -2, 2), (y, -2, 2), opacity = 0.4, mesh = True)
 Sleeping...
var('rho, t') r = vector([rho*cos(t), rho*sin(t), 2*rho]) parametric_plot3d(r, (rho, 0, 2), (t, 0, 2*pi), opacity = 0.4, mesh = True)
 Sleeping...

Ex. 8

var('x, t') f(x) = sin(x) r = vector([x, f(x)*cos(t), f(x)*sin(t)]) parametric_plot3d(r, (x, 0, 2*pi), (t, 0, 2*pi), opacity = 0.4, mesh = True)
 Sleeping...

Ex. 9

var('x, y, z, u, v') T = vector([x, y, z]) r = vector([u^2, v^2, u + 2*v]) ru = diff(r, u) rv = diff(r, v) normal = ru.cross_product(rv).subs(u = 1, v = 1) P = r.subs(u = 1, v = 1) print "Tangent Plane:", normal.inner_product(T - P) == 0 p1 = parametric_plot3d(r, (u, -2, 2), (v, -2, 2), opacity = 0.4) p2 = implicit_plot3d(normal.inner_product(T - P) == 0, (x, -1, 4), (y, -1, 4), (z, -1, 5), opacity = 0.4, color = 'red') p1 + p2
 Tangent Plane: -2*x - 4*y + 4*z - 6 == 0 Tangent Plane: -2*x - 4*y + 4*z - 6 == 0 Sleeping...

Ex. 10

var('t, p') r = vector([2*sin(p)*cos(t), 2*sin(p)*sin(t), 2*cos(p)]) rp = diff(r, p) rt = diff(r, t) integral(integral((rp.cross_product(rt)).norm(), t, 0, 2*pi), p, 0, pi)
 16*pi 16*pi

Ex. 11

var('x, y, r, t') f(x, y) = x^2 + y^2 fx = diff(f(x, y), x) fy = diff(f(x, y), y) u = r*cos(t) v = r*sin(t) integral(integral((sqrt(1 + fx^2 + fy^2).subs(x = u, y = v))*r, r, 0, 3), t, 0, 2*pi)
 -1/6*pi + 1/6*(37*sqrt(37))*pi -1/6*pi + 1/6*(37*sqrt(37))*pi

15.7. Surface Integrals

Ex. 1

var('x, y, z, t, p') f(x, y, z) = x^2 r = vector([sin(p)*cos(t), sin(p)*sin(t), cos(p)]) rp = diff(r, p) rt = diff(r, t) s = rp.cross_product(rt).simplify_full() # 중간과정에서 식을 정리하였음 s1 = (s.inner_product(s)).simplify_full() # 중간과정에서 식을 정리하였음 print s1
 sin(p)^2 sin(p)^2
integral(integral(f(r[0], r[1], r[2])*sin(p), p, 0, pi), t, 0, 2*pi)
 4/3*pi 4/3*pi

Ex. 2

var('x, y') g(x, y) = x + y^2 plot3d(g, (x, 0, 1), (y, 0, 2), opacity = 0.4)
 Sleeping...
gx = diff(g(x, y), x) gy = diff(g(x, y), y) integral(integral(y*sqrt(1 + gx^2 + gy^2), y, 0, 2), x, 0, 1)
 13/3*sqrt(2) 13/3*sqrt(2)

Ex. 3

var('x, y, z') p1 = plot3d(0, (x, -1, 1), (y, -1, 1), color = 'green', opacity = 0.4) p2 = implicit_plot3d(x^2 + y^2 == 1, (x, -1, 1), (y, -1, 1), (z, 0, 2), color = 'red', opacity = 0.4) p3 = plot3d(1 + x, (x, -1, 1), (y, -1, 1), opacity = 0.4) p1 + p2 + p3
 Sleeping...
# S1 var('t') r = vector([cos(t), sin(t), z]) rt = diff(r, t) rz = diff(r, z) rtrz = rt.cross_product(rz) print rtrz.inner_product(rtrz).simplify_full()
 1 1
integral(integral(z, z, 0, 1 + cos(t)), t, 0, 2*pi)
 3/2*pi 3/2*pi
# S3 var('r') g(x, y) = 1 + x gx = diff(g(x, y), x) gy = diff(g(x, y), y) u = r*cos(t) v = r*sin(t) integral(integral((((1 + x)*sqrt(1 + gx^2 + gy^2)).subs(x = u, y = v))*r, r, 0, 1), t, 0, 2*pi)
 sqrt(2)*pi sqrt(2)*pi

Ex. 4

var('x, y, z, p, t') F = vector([z, y, x]) r = vector([sin(p)*cos(t), sin(p)*sin(t), cos(p)]) p1 = plot_vector_field3d(F, (x, -1, 1), (y, -1, 1), (z, -1, 1)) p2 = parametric_plot3d(r, (p, 0, pi), (t, 0, 2*pi), opacity = 0.4) p1 + p2
 Sleeping...
rp = diff(r, p) rt = diff(r, t) integral(integral(F(x = r[0], y = r[1], z = r[2]).inner_product(rp.cross_product(rt)), p, 0, pi), t, 0, 2*pi)
 4/3*pi 4/3*pi

Ex. 5

var('x, y, z') F = vector([y, x, z]) g(x, y) = 1 - x^2 - y^2 p1 = plot_vector_field3d(F, (x, -1, 1), (y, -1, 1), (z, -1, 1)) p2 = plot3d(g, (x, -1, 1), (y, -1, 1), opacity = 0.4) p3 = plot3d(0, (x, -1, 1), (y, -1, 1), opacity = 0.4, color = 'orange') p1 + p2 + p3
 Sleeping...
# S1 var('r, t') P, Q, R = F gx = diff(g(x, y), x) gy = diff(g(x, y), y) u = r*cos(t) v = r*sin(t) integral(integral((r*((-P*gx - Q*gy + R.subs(z = g(x, y))).subs(x = u, y = v))).simplify_full(), r, 0, 1), t, 0, 2*pi)
 1/2*pi 1/2*pi
# S2 n = vector([0, 0, -1]) print F.inner_product(n).subs(z = 0)
 0 0

15.8. Stokes’ Theorem

Ex. 1

var('x, y, z') F = vector([-y^2, x, z^2]) p1 = plot_vector_field3d(F, (x, -1, 1), (y, -1, 1), (z, 1, 3)) p2 = implicit_plot3d(y + z == 2, (x, -1, 1), (y, -1, 1), (z, 1, 3), opacity = 0.4) p3 = implicit_plot3d(x^2 + y^2 == 1, (x, -1, 1), (y, -1, 1), (z, 1, 3), opacity = 0.4, color = 'red') p1 + p2 + p3
 Sleeping...
var('x, y, z') def curl(F): # curl 함수를 정의 assert(len(F) == 3) # 3차원 벡터인지 확인 curl = vector([diff(F[2], y) - diff(F[1], z), diff(F[0], z) - diff(F[2], x), diff(F[1], x) - diff(F[0], y)]) return curl print curl(F)
 (0, 0, 2*y + 1) (0, 0, 2*y + 1)
var('r, t') P, Q, R = curl(F) g(x, y) = 2 - y gx = diff(g(x, y), x) gy = diff(g(x, y), y) u = r*cos(t) v = r*sin(t) integral(integral((r*((-P*gx - Q*gy + R.subs(z = g(x, y))).subs(x = u, y = v))).simplify_full(), r, 0, 1), t, 0, 2*pi)
 pi pi

Ex. 2

var('x, y, z') F = vector([x*z, y*z, x*y]) p1 = plot_vector_field3d(F, (x, -2, 2), (y, -2, 2), (z, -2, 2)) p2 = implicit_plot3d(x^2 + y^2 + z^2 == 4, (x, -2, 2), (y, -2, 2), (z, -2, 2), opacity = 0.4) p3 = implicit_plot3d(x^2 + y^2 == 1, (x, -2, 2), (y, -2, 2), (z, -2, 2), opacity = 0.4, color = 'red') p1 + p2 + p3
 Sleeping...
solve([x^2 + y^2 + z^2 == 4, x^2 + y^2 == 1], x, y, z)
 [[x == r1, y == -sqrt(-r1^2 + 1), z == -sqrt(3)], [x == r2, y == -sqrt(-r2^2 + 1), z == sqrt(3)], [x == r3, y == sqrt(-r3^2 + 1), z == -sqrt(3)], [x == r4, y == sqrt(-r4^2 + 1), z == sqrt(3)]] [[x == r1, y == -sqrt(-r1^2 + 1), z == -sqrt(3)], [x == r2, y == -sqrt(-r2^2 + 1), z == sqrt(3)], [x == r3, y == sqrt(-r3^2 + 1), z == -sqrt(3)], [x == r4, y == sqrt(-r4^2 + 1), z == sqrt(3)]]
var('t') r = vector([cos(t), sin(t), sqrt(3)]) dr = diff(r, t) integral(F(x = r[0], y = r[1], z = r[2]).inner_product(dr), t, 0, 2*pi)
 0 0

15.9. The Divergence Theorem

Ex. 1

var('x, y, z') F = vector([z, y, x]) p1 = plot_vector_field3d(F, (x, -1, 1), (y, -1, 1), (z, -1, 1)) p2 = implicit_plot3d(x^2 + y^2 + z^2 == 1, (x, -1, 1), (y, -1, 1), (z, -1, 1), opacity = 0.4, color = 'red') p1 + p2
 Sleeping...
var ('x, y, z') def divergence(F): # div 함수를 정의 assert(len(F) == 3) # 3차원 벡터인지 확인 return diff(F[0], x) + diff(F[1], y) + diff(F[2], z) print divergence(F)
 1 1

Ex. 2

var('x, y, z') p1 = plot3d(1 - x^2, (x, -2, 2), (y, -2, 2), opacity = 0.4) p2 = plot3d(0, (x, -2, 2), (y, -2, 2), opacity = 0.4, color = 'red') p3 = implicit_plot3d(y == 0, (x, -2, 2), (y, -2, 2), (z, -2, 2), opacity = 0.4, color = 'green') p4 = implicit_plot3d(y + z == 2, (x, -2, 2), (y, -2, 2), (z, -2, 2), opacity = 0.4, color = 'orange') p1 + p2 + p3 + p4
 Sleeping...
var ('x, y, z') def divergence(F): # div 함수를 정의 assert(len(F) == 3) # 3차원 벡터인지 확인 return diff(F[0], x) + diff(F[1], y) + diff(F[2], z) F = vector([x*y, y^2 + exp(x*z^2), sin(x*y)]) print divergence(F)
 3*y 3*y
integral(integral(integral(divergence(F), y, 0, 2 - z), z, 0, 1 - x^2), x, -1, 1)
 184/35 184/35