Use integration by substitution to solve the integral below. \[ \int 4 e^{-7 x} d x \]
Solution:
Assume that \(u=-7 x\). Then, \(\frac{d u}{d x}=-7\), which implies \(d x=\frac{d u}{-7}\)
Rewrite the integral in terms of \(u: \int 4 e^{-7 x} d x=\int 4 e^{\mathrm{u}} \frac{d u}{-7}=\left(\frac{-4}{7}\right) \int e^{\mathrm{u}} d u\)
The integral of \(e^{\mathrm{u}}\) with respect to \(u\) is simply \(e^{\mathrm{u}}+C\), where \(C\) is the constant of integration.
So, the integral is \(\quad=\left(\frac{-4}{7}\right) * e^{\mathrm{u}}+C\) substitute back \(u=-7 x\) : the integral \(\int 4 e^{-7 \mathrm{x}} d x\) is \[ =\left(\frac{-4}{7}\right) * e^{-7 \mathrm{x}}+C \]
# If x=2, C = 3,
x <- 2
C <- 3
# Find the result of the integral value
result <- ((-4)/7) * exp(-7 * x) + C
result
## [1] 3
Biologists are treating a pond contaminated with bacteria. The level of contamination is changing at a rate of dN/dt=-3150/t^4 -220 bacteria per cubic centimeter per day, where t is the number of days since treatment began. Find function N(t) to estimate the level of contamination if the level after 1 day was 6530 bacteria per cubic centimeter.
Solution:
The rate of contamination level is \[ \frac{d N}{d t}=-\frac{3150}{t^4}-220 \]
the initial condition \(N(1)=6530\),
To find \(N(t)\), integrate the differential equation with respect to \(t\) : \[ \begin{aligned} & \int \frac{d N}{d t} d t=\int\left(-\frac{3150}{t^4}-220\right) d t=\int-\frac{3150}{t^4} d t-\int 220 d t \\ & N(t)=-\frac{3150}{3 t^3}-220 t+C \end{aligned} \]
Substitute initial condition \(N(1)=6530\) to solve for the constant of integration C \[ \begin{aligned} & N(1)=-\frac{3150}{3(1)^3}-220(1)+C=6530 \\ & N(1)=-3150 / 3-220+C=6530 \\ & N(0)=C=6530+1270=7800 \end{aligned} \]
Find the total area of the red rectangles in the figure below, where the equation of the line is \(f(x)=2 x-9\)
library(pracma)
# Define the function representing the line f(x) = 2x - 9
f <- function(x) 2*x - 9
# Calculate the definite integral from x = 4.5 to x = 8.5
area_under_curve <- integrate(f, lower = 4.5, upper = 8.5)
# Extract the value of the integral (area under the curve)
total_area <- area_under_curve$value
# Print the total area of the region
total_area
## [1] 16
Find the area of the region bounded by the graphs of the given equations. \[ y=x^2-2 x-2, y=x+2 \]
Enter your answer below.
library(ggplot2)
# Define the functions
f1 <- function(x) x^2 - 2*x - 2
f2 <- function(x) x + 2
# Create a sequence of x values
x_values <- seq(-2, 5, length.out = 100) # Adjust the range
# Calculate the y values for each function
y1 <- f1(x_values)
y2 <- f2(x_values)
# Create a data frame with x and y values for both functions
df <- data.frame(x = x_values, y1 = y1, y2 = y2)
# Plot the two functions
ggplot(df, aes(x = x)) +
geom_line(aes(y = y1), color = "blue") +
geom_line(aes(y = y2), color = "red") +
labs(title = "Region bounded by y = x^2 - 2x - 2 and y = x + 2", x = "x", y = "y")
# Define the integrand as the absolute difference of the functions
integrand <- function(x) abs(f1(x) - f2(x))
# Calculate the integral between two intersection points
area_between_curves <- integrate(integrand, lower = -1, upper = 4)
# Find value of the integral (area)
area <- area_between_curves$value
area
## [1] 20.83333
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.
Economic Order Quantity model can be applied to find the optimal lot size, EOQ formula is
\[ Q^*=\sqrt{\frac{2 D S}{H}} \]
Where: - \(Q^*=\) Economic Order Quantity (lot size) - \(D=\) Demand (number of flat irons expected to be sold in a year) \(=110\) - \(S=\) Ordering cost per order \(=\$ 8.25\) - \(H=\) Holding cost per unit per year \(=\$ 3.75\)
# Given data
D <- 110 # Demand
S <- 8.25 # Ordering cost per order
H <- 3.75 # Holding cost per unit per year
# Calculate Economic Order Quantity (EOQ)
EOQ <- sqrt((2 * D * S) / H)
# Number of orders per year
num_orders_per_year <- D / EOQ
EOQ
## [1] 22
num_orders_per_year
## [1] 5
The optimal Lot size is 22, the number of orders per year that will minimize inventory costs is 5.
Use integration by parts to solve the integral below \[ \int \ln (9 x) * x^6 d x \]
Solution:
Suppose \(u=\ln (9 x)\) and \(d v=x^6 d x\), then differentiate \(u\) to find \(d u\) and integrate \(d v\) to find \(v\) : \[ \begin{aligned} & u=\ln (9 x) \\ & d v=x^6 d x \end{aligned} \]
Differentiating \(u\) with respect to \(x\) : \[ d u=\frac{1}{9 x} \cdot 9 d x=\frac{1}{x} d x \]
Integrating \(d v\) : \[ v=\frac{1}{7} x^7 \]
Apply the integration by parts formula: \[ \begin{aligned} & \int \ln (9 x) \cdot x^6 d x=u v-\int v d u \\ & =\ln (9 x) \cdot \frac{1}{7} x^7-\int \frac{1}{7} x^7 \cdot \frac{1}{x} d x \\ & =\frac{1}{7} x^7 \ln (9 x)-\frac{1}{7} \int x^6 d x \\ & =\frac{1}{7} x^7 \ln (9 x)-\frac{1}{7} \cdot \frac{1}{7} x^7+C \\ & =\frac{1}{7} x^7 \ln (9 x)-\frac{1}{49} x^7+C \end{aligned} \]
Determine whether \(f(x)\) is a probability density function on the interval \(\left[1, e^6\right]\). If not, determine the value of the definite integral.
# Define the function
f <- function(x) 1 / (6 * x)
# Define the interval
a <- 1
b <- exp(6)
# Check if the function is non-negative on the interval [1, e^6]
non_negative <- all(sapply(seq(a, b, length.out = 100), function(x) f(x) >= 0))
non_negative
## [1] TRUE
# Calculate the definite integral
integral_value <- integrate(f, lower = a, upper = b)$value
# Output the result
integral_value
## [1] 1