Calculus (Chapter 7 - Area Between Curves) - Chapter 7.1

(Question 7): Find the area of the shaded region in the given graph:
Week13 Discussion_01
Solution:

To find the area of the shaded region, we have to find the area between the two curves \(y = sin(x) + 1\) and \(y = sin(x)\):

  • Calculate the area (\(area_1\)) under the curve \(y = sin(x) + 1\) between \(0\) and \(\pi\)
  • Calculate the area (\(area_2\)) under the curve \(y = sin(x)\) between \(0\) and \(\pi\)
  • Caluclate the difference between the areas (\(area_1 - area_2\)). This will give the area of the shaded region
  • \(f_1(x) = sin(x) + 1\)
    \(f_2(x) = sin(x)\)
    \(area_1 = \int_{0}^{\pi}f_1(x) dx\)
    \(area_2 = \int_{0}^{\pi}f_2(x) dx\)
    \(area = area_1 - area_2\)
    \(area = \int_{0}^{\pi}f_1(x) dx - \int_{0}^{\pi}f_2(x) dx\)
    \(area = \int_{0}^{\pi} (f_1(x) - f_2(x)) dx\)
    \(area = \int_{0}^{\pi} (sin(x) + 1 - sin(x)) dx\)
    \(area = \int_{0}^{\pi} (1) dx\)
    \(area = x \vert_{0}^{\pi} = \pi - 0\)
    \(area = \pi = 3.141593\)

    R Language Solution
    #Find area in-build function
    f1 = function(x) {sin(x) + 1}
    f2 = function(x) {sin(x)}
    
    #Find the difference between areas under the curve
    area1 <- integrate(f1, 0, pi)
    area2 <- integrate(f2, 0, pi)
    area <- (area1$value - area2$value)
    print(c(area1$value, area2$value))
    ## [1] 5.141593 2.000000
    print(area)
    ## [1] 3.141593
    (Question 10): Find the area of the shaded region in the given graph:
    Week13 Discussion_02
    Solution:

    To find the area of the shaded region, we have to find the area between the two curves \(y = 4^x\) and \(y = 2^x\):

  • Calculate the area (\(area_3\)) under the curve \(y = 4^x\) between \(0\) and \(1\)
  • Calculate the area (\(area_4\)) under the curve \(y = 2^x\) between \(0\) and \(1\)
  • Caluclate the difference between the areas (\(area_3 - area_4\)). This will give the area of the shaded region
  • \(f_3(x) = 4^x\)
    \(f_4(x) = 2^x\)
    \(area_3 = \int_{0}^{1}f_3(x) dx\)
    \(area_4 = \int_{0}^{1}f_4(x) dx\)
    \(area = area_3 - area_4\)
    \(area = \int_{0}^{1}f_3(x) dx - \int_{0}^{1}f_4(x) dx\)
    \(area = \int_{0}^{1} (f_3(x) - f_4(x)) dx\)
    \(area = \int_{0}^{1} (4^x - 2^x) dx\)
    \(area = (\frac{4^x}{ln(4)}-\frac{2^x}{ln(2)}+C) \vert_{0}^{1}\)
    \(area = (\frac{4^1}{ln(4)}-\frac{2^1}{ln(2)}+C) - (\frac{4^0}{ln(4)}-\frac{2^0}{ln(2)}+C)\)
    \(area = (\frac{4}{ln(4)}-\frac{1}{ln(4)}+C-\frac{2}{ln(2)}+\frac{1}{ln(2)}-C)\)
    \(area = (\frac{3}{ln(4)}-\frac{1}{ln(2)})\)
    \(area = (2.16404256 - 1.44269504)\)
    \(area = 0.72134752\)

    R Language Solution
    #Find area in-build function
    f3 = function(x) {4^x}
    f4 = function(x) {2^x}
    
    #Find the difference between areas under the curve
    area3 <- integrate(f3, 0, 1)
    area4 <- integrate(f4, 0, 1)
    area <- (area3$value - area4$value)
    print(c(area3$value, area4$value))
    ## [1] 2.164043 1.442695
    print(area)
    ## [1] 0.7213475