Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Hailey Matanes Sage Presentation

Views: 139
# In this worksheet, we will be finding the area between two curves using concepts learned in Calculus. # Sketch the graph of the curve f(x) = 6 - x ^ 2 plot( 6 - x ^ 2 , -10, 10 )
# On the same plane, sketch the curve above and f(x) = -10 plot ( 6 - x ^ 2, -10, 10 ) + plot ( -10 , -10, 10, color='red' )
# To find the area between the curves, we will have to determine where the curves intersect. These intersection points will become our interval for integration. solve ( 6 - x ^ 2 == -10 , x )
[x == -4, x == 4]
# Now, we are going to integrate to find the area. # The formula for the area between to curves is int(upper)dx - int(lower)dx (bounded by the appropriate interval) from sage.symbolic.integration.integral import definite_integral definite_integral( 6 - x ^ 2 , x , -4 , 4 ) - definite_integral ( -10 , x , -4 , 4 )
256/3
# The solution to the definite integral, 256/3, is the area between the two curves. integral ( 6 - x ^ 2 , x ) - integral ( -10 , x)
-1/3*x^3 + 16*x
# In my research for computing integrals in Sage, I found the computations below as a quick way to find all of the information we found above. I wanted to go through the steps one-by-one and then lay out the following as an alternative method. b= 6 - x^2 r= -10 e=solve(b==r,x) print "Points of intersection" print e d=integrate(b-r,-4,4) print "Area under two curves is:" print d
Points of intersection [ x == -4, x == 4 ] Area under two curves is: 256/3