Use integration by substitution to solve the integral below
\(\int 4e^{-7x} \, dx\)
Let \(u = -7x\)
\(du= -7 dx\)
\(dx=- \frac{1}{7} du\)
That will make the integral
\(\int 4e^{u} \left(-\frac{1}{7}\right) \, du\)
\(-\frac{4}{7} \int e^{u} du\)
Which is:
\(-\frac{4}{7} e^{u} + C\)
\(-\frac{4}{7} e^{-7x} + C\)
\(\int 4e^{-7x} \, dx= -\frac{4}{7} e^{-7x} + C\)
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 6530 bacteria per cubic centimeter.
library(pracma)
## Warning: package 'pracma' was built under R version 4.3.2
dN_dt = function(t) {
-3150 / t^4 - 220
}
n_t = function(t) {
int = integral(dN_dt, 1, t)
n_1 = 6530
n_t = int + n_1
return(n_t)
}
n_t(8)
## [1] 3942.051
The function n_t represents the answer N(t). For example; after 8 days, the level of contamination is estimated to be 3942.051.
Find the total area of the red rectangles in the figure below, where the equation of the line is \(f(x)=2x-9\)
I will estimate the area under the line using reimann sum.
f = function(x) {
2 * x - 9
}
total_area = 0
for (x in seq(4.5, 7.5, by = 1)) {
height = f(x)
width = 1
total_area = total_area + height * width
}
cat("The total area of the red rectanges is", total_area, "units cubed \n")
## The total area of the red rectanges is 12 units cubed
Find the area of the region bounded by the graphs of the given equations:
\(y=x^2-2x-2 , y=x+2\)
y1 = function(x) { x^2 - 2*x - 2 }
y2 = function(x) { x + 2 }
#points of intersection
points_of_intersection = function() {
#quadratic form
solutions = polyroot(c(-4, -3, 1))
#only real no imaginary
real_solutions = Re(solutions)
return(real_solutions)
}
# area btween functions
find_area = function(intersections) {
area = integrate(function(x) { y2(x) - y1(x) }, min(intersections), max(intersections))$value
#abs bc area is positive
return(abs(area))
}
#points of intersections and bounds
intersections = points_of_intersection()
area4 = find_area(intersections)
cat("The area between the two functions is", area4, "units squared. \n")
## The area between the two functions is 20.83333 units squared.
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.
demand= 110
fixed_cost=8.25
hold_cost=3.75
#EOQ forumla
quant=sqrt((2*demand*fixed_cost)/hold_cost)
order_n=demand/quant
cat("The order quantity that minimizes inventory costs is", quant, "flat irons \n")
## The order quantity that minimizes inventory costs is 22 flat irons
cat("The number of orders per year that minimizes inventory costs is", order_n, "orders \n")
## The number of orders per year that minimizes inventory costs is 5 orders