# 미분적분학실습2-Week-5

## 1293 days ago by jhlee2chn

var('x, y') region_plot(4 - x^2 + y >= 0, (x, -3, 3), (y, -3, 3), incol='lightblue', bordercol='black')
var('x, y') region_plot([4 - x^2 + y >= 0, 9 - y^2 - x^2 >= 0], (x, -3, 3), (y, -3, 3), incol='lightblue', bordercol='black')
f(x, y) = x*log(y^2 - x) f(3, 2)
 0 0
var('x, y') region_plot(9-x^2 - y^2 >= 0, (x, -3, 3), (y, -3, 3), incol='lightblue')
f(x,y)=cos(x)*cos(y) plot3d(f(x,y), (x, -10, 10), (y, -10, 10), opacity=0.4)
 Sleeping...
contour_plot(f(x, y), (x, -3, 3), (y, -3, 3), contours=[-1,-0.98..1], fill=False, cmap='hsv', labels=True)
var('x, y') contour_plot(sqrt(9-x^2-y^2), (x, -4, 4), (y, -4, 4), contours=[0,0.1..2], fill=False, labels=True)
f(x,y)=sqrt(4-4*x^2-y^2) implicit_plot3d(z^2==4-4*x^2-y^2, (x, -1, 1), (y, -2, 2), (z, -2, 2), opacity=0.4, aspect_ratio=[1,1,1])
 Sleeping...
var('x, y') contour_plot(y-arctan(x), (x, -10, 10), (y, -10, 10), fill=False, cmap='hsv', labels=True)
var('x, y, z') f(x, y, z) = x^2 + y^2 + z^2 p = Graphics() for k, col in [(1, 'red'), (2, 'orange'), (3, 'yellow'), (4, 'lightblue'), (5, 'green')]: p += implicit_plot3d(f(x, y, z) == k, (x, -3, 3), (y, -3, 3), (z, -3, 3), opacity = 0.4, color = col) p
 Sleeping...
var('x, y') region_plot([x+y>=-1, x+y<=1], (x, -3, 3), (y, -3, 3), incol='lightblue')
var('x, y') f=100*(x^2-y)^2+(x-1)^2 # Rosenbrock function contour_plot(f, (x,-1.5, 3), (y, -1.5, 5), contours=[0, 2,..,200], cmap='hsv', fill=False)
var('x, y') f(x, y) = (x^2 - y^2)/(x^2 + y^2) print limit(f(x, 0), x = 0) print limit(f(0, y), y = 0)
 1 -1 1 -1
var('x, y') f(x, y) = x*y/(x^2 + y^2) print limit(f(x, 0), x = 0) print limit(f(x, x), x = 0)
 0 1/2 0 1/2
var('x, y') f(x, y) = 3*x^2*y/(x^2 + y^2) print limit(f(x, 0), x = 0)
 0 0
var('x, y') f(x, y) = (x^2*y^3 - x^3*y^2 + 3*x + 2*y) limit(limit(f(x, y), x = 1), y = 2)
 11 11
var('x, y') f(x, y) = x*y^3/(x^2 + y^6) print limit(f(x, 0), x = 0) print limit(f(y^3, y), y = 0)
 0 1/2 0 1/2
plot3d(f(x, y), (x, -1, 1), (y, -1, 1))
 Sleeping...
var('x, y') f(x, y) = x^3 + x^2*y^3 - 2*y^2 dfdx = diff(f, x) print dfdx dfdy = diff(f, y) print dfdy
 (x, y) |--> 2*x*y^3 + 3*x^2 (x, y) |--> 3*x^2*y^2 - 4*y (x, y) |--> 2*x*y^3 + 3*x^2 (x, y) |--> 3*x^2*y^2 - 4*y
var('x, y') f(x, y) = sin(x / (1 + y)) print "fx = ", diff(f(x, y), x) print "fy = ", diff(f(x, y), y)
 fx = cos(x/(y + 1))/(y + 1) fy = -x*cos(x/(y + 1))/(y + 1)^2 fx = cos(x/(y + 1))/(y + 1) fy = -x*cos(x/(y + 1))/(y + 1)^2
var('x, y, z') f(x, y, z) = exp(x*y)*log(z) fx = diff(f(x, y, z), x) fy = diff(f(x, y, z), y) fz = diff(f(x, y, z), z) print fx print fy print fz
 y*e^(x*y)*log(z) x*e^(x*y)*log(z) e^(x*y)/z y*e^(x*y)*log(z) x*e^(x*y)*log(z) e^(x*y)/z
var('x, y') f(x, y) = x^3 + x^2*y^3 - 2*y^2 print diff(diff(f(x, y), x), x) print diff(diff(f(x, y), x), y) # fxy print diff(diff(f(x, y), y), x) # fyx print diff(diff(f(x, y), y), y)
 2*y^3 + 6*x 6*x*y^2 6*x*y^2 6*x^2*y - 4 2*y^3 + 6*x 6*x*y^2 6*x*y^2 6*x^2*y - 4
var('x, y') f(x, y) = x^3 + x^2*y^3 - 2*y^2 dfdx = diff(f, x) print dfdx(x, y) dfdy = diff(f, y) print dfdy(x, y)
 2*x*y^3 + 3*x^2 3*x^2*y^2 - 4*y 2*x*y^3 + 3*x^2 3*x^2*y^2 - 4*y
var('x, y') f(x, y) = sin(x / (1 + y)) print "fx = ", diff(f(x, y), x) print "fy = ", diff(f(x, y), y)
 fx = cos(x/(y + 1))/(y + 1) fy = -x*cos(x/(y + 1))/(y + 1)^2 fx = cos(x/(y + 1))/(y + 1) fy = -x*cos(x/(y + 1))/(y + 1)^2
var('x, y, z') f(x, y, z) = exp(x*y)*log(z) fx = diff(f(x, y, z), x) fy = diff(f(x, y, z), y) fz = diff(f(x, y, z), z) print fx print fy print fz
 y*e^(x*y)*log(z) x*e^(x*y)*log(z) e^(x*y)/z y*e^(x*y)*log(z) x*e^(x*y)*log(z) e^(x*y)/z
var('x, y, z') f(x, y, z) = sin(3*x+y*z) print diff(diff(diff(f(x, y, z), x, 2), y), z) print diff(diff(diff(diff(f(x, y, z), z), x), y), x)
 9*y*z*sin(y*z + 3*x) - 9*cos(y*z + 3*x) 9*y*z*sin(y*z + 3*x) - 9*cos(y*z + 3*x) 9*y*z*sin(y*z + 3*x) - 9*cos(y*z + 3*x) 9*y*z*sin(y*z + 3*x) - 9*cos(y*z + 3*x)
u(x, y)= exp(x)*sin(y) print diff(u(x, y), x, 2) print diff(u(x, y), y, 2)
 e^x*sin(y) -e^x*sin(y) e^x*sin(y) -e^x*sin(y)
var('x,t,a') u(x, t)= sin(x-a*t) print diff(u(x, t), t, 2) print a^2*diff(u(x, t), x, 2)
 -a^2*sin(-a*t + x) -a^2*sin(-a*t + x) -a^2*sin(-a*t + x) -a^2*sin(-a*t + x)
var('x, y, z') f(x, y, z) = y*z + x*log(y) - z^2 fx = diff(f(x, y, z), x) fy = diff(f(x, y, z), y) fz = diff(f(x, y, z), z) print "zx = ", -fx/fz print "zy = ", -fy/fz
 zx = -log(y)/(y - 2*z) zy = -(z + x/y)/(y - 2*z) zx = -log(y)/(y - 2*z) zy = -(z + x/y)/(y - 2*z)
var('u, v') w(u, v) = sqrt(1 + u*v^2) print diff(diff(w(u, v), u), u) print diff(diff(w(u, v), u), v) # Wuv print diff(diff(w(u, v), v), u) # Wvu print diff(diff(w(u, v), v), v)
 -1/4*v^2*v^2/(u*v^2 + 1)^(3/2) -1/2*u*v^2*v/(u*v^2 + 1)^(3/2) + v/sqrt(u*v^2 + 1) -1/2*u*v^3/(u*v^2 + 1)^(3/2) + v/sqrt(u*v^2 + 1) -u^2*v^2/(u*v^2 + 1)^(3/2) + u/sqrt(u*v^2 + 1) -1/4*v^2*v^2/(u*v^2 + 1)^(3/2) -1/2*u*v^2*v/(u*v^2 + 1)^(3/2) + v/sqrt(u*v^2 + 1) -1/2*u*v^3/(u*v^2 + 1)^(3/2) + v/sqrt(u*v^2 + 1) -u^2*v^2/(u*v^2 + 1)^(3/2) + u/sqrt(u*v^2 + 1)
var('x, y, z') f(x, y) = 2*x^2 + y^2 fx = diff(f, x) fy = diff(f, y) print z == f(1, 1) + fx(1, 1)*(x - 1) + fy(1, 1)*(y - 1) p1 = plot3d(f(x, y), (x, -1, 3), (y, -1, 3), opacity = 0.4) p2 = plot3d(f(1, 1) + fx(1, 1)*(x - 1) + fy(1, 1)*(y - 1), (x, -1, 3), (y, -1, 3), opacity = 0.4, color = 'red') p1 + p2
 z == 4*x + 2*y - 3 z == 4*x + 2*y - 3 Sleeping...
var('x, y') f(x, y) = x*exp(x*y) fx = diff(f, x) fy = diff(f, y) L(x, y) = f(1, 0) + fx(1, 0)*(x - 1) + fy(1, 0)*(y - 0) print "L(x, y) =", L(x, y) print "f(1.1, -0.1) =", f(1.1, -0.1) print "L(1.1, -0.1) =", L(1.1, -0.1)
 L(x, y) = x + y f(1.1, -0.1) = 0.985417548826181 L(1.1, -0.1) = 1.00000000000000 L(x, y) = x + y f(1.1, -0.1) = 0.985417548826181 L(1.1, -0.1) = 1.00000000000000
var('x, y') f(x, y) = x^2 + 3*x*y - y^2 fx = diff(f, x) fy = diff(f, y) print fx print fy
 (x, y) |--> 2*x + 3*y (x, y) |--> 3*x - 2*y (x, y) |--> 2*x + 3*y (x, y) |--> 3*x - 2*y
print "dz =", fx(2, 3)*0.05+fy(2,3)*(-0.04) print "delta z=", f(2.05, 2.96)-f(2,3)
 dz = 0.650000000000000 delta z= 0.644900000000002 dz = 0.650000000000000 delta z= 0.644900000000002
var('r,h') V(r, h) = 1/3*pi*r^2*h Vr = diff(V, r) Vh = diff(V, h) print "dV =", Vr(10, 25)*0.1+Vh(10, 25)*0.1
 dV = 20.0000000000000*pi dV = 20.0000000000000*pi
var('x, y, z') f(x, y) = log(x-2*y) fx = diff(f, x) fy = diff(f, y) print z == f(3, 1) + fx(3, 1)*(x - 3) + fy(3, 1)*(y - 1) p1 = plot3d(f(x, y), (x, 0, 4), (y, -1, 3), opacity = 0.4) p2 = plot3d(f(3, 1) + fx(3, 1)*(x - 3) + fy(3, 1)*(y - 1), (x, 0, 4), (y, -1, 3), opacity = 0.4, color = 'red') p1 + p2
 z == x - 2*y - 1 z == x - 2*y - 1 Sleeping...
var('x, y') f(x, y) = (1+y)/(1+x) fx = diff(f, x) fy = diff(f, y) L(x, y) = f(1, 3) + fx(1, 3)*(x - 1) + fy(1, 3)*(y - 3) print "L(x, y) =", L(x, y)
 L(x, y) = -x + 1/2*y + 3/2 L(x, y) = -x + 1/2*y + 3/2