1. Use integration by substitution to solve the integral below;

\[ \int 4e^{-7x} dx \]

We can check this with the following;

library(Ryacas)
## Warning: package 'Ryacas' was built under R version 4.3.3
## 
## Attaching package: 'Ryacas'
## The following object is masked from 'package:stats':
## 
##     integrate
## The following objects are masked from 'package:base':
## 
##     %*%, det, diag, diag<-, lower.tri, upper.tri
x <- yac_symbol('x')
fn <- 4 * exp(-7 * x)
integrate(fn, x)
## y: ((-4)*Exp((-7)*x))/7

2. Biologists are treating a pond contaminated with bacteria. The level of contamination is changing at a rate of \(\frac{dN}{dt} = -\frac{3150}{t^4} -220\) bacteria per cubic centimeter per day, where \(t\) is the number of days since treatment began. Find a function \(N(t)\) to estimate the level of contamination if the level after 1 day was 6,530 bacteria per cubic centimeter.

We want to find the contamination change over a period of \(t\) days, so we have a rate of change- and can integrate over it to find the function to estimate the total contamination;

Split into 2 integrals;

The first integral;

The second integral;

Our final integral comes to;

Contamination after 1 day= 6,530

Our general function;


3. Find the total area of the red rectangles in the figure below, where the equation of the line is \(f(x) = 2x - 9\)

Area <- function(x) {2*(x)-9}
integrate(Area, lower = 4.5, upper = 8.5)
## 16 with absolute error < 1.8e-13

4. Find the area of the region bounded by the graphs of the given equations

\[ y = x^2 - 2x - 2 \]

\[ y= x+2 \]

First, find where these lines intersect;

Plot the 2 lines

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.3
# Define our functions
f_y1 = function(x) (x^2 - 2*x - 2)
f_y2 = function(x) (x + 2)

# Empty frame to store values
df = data.frame()

# loop to obtain values for each x
for (x in seq(-2, 5, length.out = 500)) {
  result <- list(x = x, 
                 y1 = f_y1(x), 
                 y2 = f_y2(x))
  # Insert into empty frame
  df <- rbind(df, result)
}

# Plot
df %>%
  ggplot() +
  geom_line(aes(x, y1), color = 'green') +
  geom_line(aes(x, y2), color = 'blue')

Area1 <- function(x) {x+2}
Area2 <- function(x) {x^2 - 2*x-2}

integrate(Area1, lower = -1, upper = 4) #17.5
## 17.5 with absolute error < 1.9e-13
integrate(Area2, lower = -1, upper = 4) #-3.333333
## -3.333333 with absolute error < 1.2e-13
17.5 - -3.333333
## [1] 20.83333

5. A beauty supply store expects to sell 110 flat irons during the next year. It costs $3.75 to store one flat iron for one year. There is a fixed cost of $8.25 for each order. Find the lot size and the number of orders per year that will minimize inventory costs.

So our lot size = 15.56, and to find the number of orders we divide it from 110, the total number of irons we expect to sell; number of orders = 7.0694087403 -> 7 orders


6. Use integration by parts to solve the integral below.

\[ \int ln(9x) x^6 dx \]

Using Ryacas library to confirm

x <- yac_symbol('x')
fn <- log(9*x)*x^6
integrate(fn, x)
## y: (Ln(9*x)*x^7)/7-x^7/49

7. Determine whether \(f(x)\) is a probability density function on the interval \([1, e^6]\) . If not, determine the value of the definite integral.

\[ f(x) = \frac{1}{6x} \]

PDF’s have 2 properties- all values must be positive, and the area under the curve must sum to 1. The first condition is clearly satisfied based on the defined interval, as it evaluates to \(\frac{1}{6} * ln(x) | 1 \to e^6 = \frac{1}{6} ln(e^6) - \frac{1}{6}ln(1) = 1-0\). To test the second condition, we can find the integral of the function and check if it equals 1.

f <- function(x) 1 / (6*x)
integrate(f, 1, exp(6))
## 1 with absolute error < 9.3e-05

The conditions are met, thus this is a proper PDF.