2-문제2-이유진

1158 days 전, yuwls1102 작성

var('x') f(x) = 3*x^2-6*x+2 x1 = 4 y1 = f(x1) df(x) = diff(f(x), x) print df(x) 
       
6*x - 6
6*x - 6
m = df(x1) # 접선의 기울기 print m 
       
18
18
p1 = plot(f(x),(x,0,5)) p2 = plot(y1 + m*(x-x1), (x, 0, 5), color='green') p3 = point([x1,y1],color='green') p1+p2+p3 
       
print "y = ", y1 + m*(x-x1) 
       
y =  18*x - 46
y =  18*x - 46