Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
9 views
# Using the information proivded in the 'Differentiation' tutorial on # http://sage.ccjohnson.org, answer the problems in the attached PDF using # Sage in this worksheet. (The PDF is also available on Sakai.) # 1 diff(cos(x^2) + sin(x^2) - cos(sin(x^2)) + sin(cos(x^2)))
-2*x*cos(cos(x^2))*sin(x^2) + 2*x*cos(x^2)*sin(sin(x^2)) + 2*x*cos(x^2) - 2*x*sin(x^2)
# 2 graph = f(x) = x^2 * sqrt(sin(x) + 2) Df(x) = diff(f) curve = plot(f(x), (x, 0, 10)) var('y') tanline = implicit_plot(y - f(3) == Df(3) * (x-3), (x, 0, 10), (y, 0, 15), \ color='red')
y
curve += plot(tanline)
show(curve)
# 3 f(x) = (arctan(sin(x * ln(x^2 + 1)))) curve = plot(f(x), (x, 0, 10))
Df = diff(f) D2f = diff(Df) curve += plot(Df, (x, 0, 10), color='red') curve += plot(D2f, (x, 0 ,10), color='green') show(curve)
# 4 s(x) = f(x) s(x) = g(x) s(x) = h(x) Ds(x) = diff(s) def newton(s, x0, n): counter = 1 while counter <= n: x0 = x0 - s(x0) / Ds(x0) counter += 1 return x0 # 5 P(x) = 6 * x^12 - 12 * x^6 + 7 * x^4 Q(x) = 12 * x^9 + x^7 + 3 * x solve(P(x) == Q(x), x) graph = plot(P(x), (x, 1, 2)) graph += plot(Q(x), (x, 1,2), color='red') show(graph)
[x == 0, 0 == 6*x^11 - 12*x^8 - x^6 - 12*x^5 + 7*x^3 - 3]
DP(x) = diff(P) def newton(P, x0, n): counter = 1 while counter <= n: x0 = x0 - s(x0) / Ds(x0) counter += 1 return x0 print newton(P, 1.38366, 50)
0.933104439922602
DQ(x) = diff(Q) def newton(Q, x0, n): counter = 1 while counter <= n: x0 = x0 - s(x0) / Ds(x0) counter += 1 return x0 print newton(Q, 1.38366, 50)
0.933104439922602
# t == 1.38366 # pont where P(x) and Q(x) cross is (1.38366, 0.933104439922602) ︠52c3df6e-4604-4d8a-883f-0652176dd7eb︠