# 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 ^ 2plot(6-x^2,-10,10)
# On the same plane, sketch the curve above and f(x) = -10plot(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)fromsage.symbolic.integration.integralimportdefinite_integraldefinite_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^2r=-10e=solve(b==r,x)print"Points of intersection"printed=integrate(b-r,-4,4)print"Area under two curves is:"printd
Points of intersection
[
x == -4,
x == 4
]
Area under two curves is:
256/3