#Find area in-build function
f3 = function(x) {2*x -9}
#Find the difference between areas under the curve
area3 <- integrate(f3, 4.5, 8.5)$value
area3 <- round(as.numeric(area3))
print(area3)
## [1] 16
#Find area in-build function
f1 = function(x) {x + 2}
f2 = function(x) {x^2 -2*x -2}
#Find the difference between areas under the curve
area1 <- integrate(f1, -1, 4)
area2 <- integrate(f2, -1, 4)
area <- round((area1$value - area2$value),4)
print(area)
## [1] 20.8333