1. Use integration by substituion to solve the integral below.
\[\int e^{-7x}dx\]
Solution:
Let \(u = -7x\). Therefore, \(\frac{du}{dx} = -7\), or in other words, \(du = -7 dx\).
\[-4 * \frac{1}{7} \int -7 e^{-7x}dx = -4 * \frac{1}{7} \int e^{u}du =(-4 * \frac{1}{7}) e^{u} = \frac{-4}{7}e^{-7x} + c\]
The solution is: \(\frac{-4}{7}e^{-7x} + c\)
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 6350 bacteria per cubic centimer.
To find \(N(t)\), we must integrate.
\[\int \frac{dN}{dt} = \int - \frac{3150}{t^4}-220 dt = \int -3150t^{-4}-220dt \] \[N(t) = \frac{-3150}{-3}t^{-3} - 220t + c = \frac{1050}{t^3} - 220t + c\] \[N(1) = 6350 = \frac{1050}{1^3} - 220(1) + c = 1050 - 220 + c = 830 + c\]
Now solving for c, \(6350 - 830 = c\), c = 5520. Therefore, solution for \(N(t)\) is:
\[N(t) = \frac{1050}{t^3} - 220t + 5520\]
3. Find the total area of the red rectangles in the figure below, where the equation of the line if \(f(x) = 2x-9\).
If we obtained the Reimann Sums, we can simply add up the area of the boxes. Int his particular case, the Reimann Sums is the sum of the four boxes here, which is: 16.
To get an exact answer, we definite integrate the above function from values 4.5 to 8.5.
\[F(x) = \int_{4.5}^{8.5} f(x) dx = \int_{4.5}^{8.5} 2x-9 dx = x^2-9x + c\] Given that the boundaries are from 4.5 to 8.5, we can perform \(F(8.5) - F(4.5)\).
\[F(8.5) - F(4.5) = 8.5^2 - 9*8.5 - (4.5^2 - 9*4.5) = 16\] The exact area under the curve is: 16.
4. Find the area of the region bounded by the graphs of the given equations.
\[y = x^2 - 2x - 2, y = x + 2\]
# Create the equations
eqn1 <- function(x){
return(x**2 -2*x - 2)
}
eqn2 <- function(x){
return(x + 2)
}
x <- seq(-2, 5, 1)
y <- eqn2(x)
# Plot the graphs
plot(eqn1, from = -2, to = 5, line = "l", col = 'blue') # Eqn1
lines(x,y, col = 'green') # Eqn2
# Where do the equations intersect
# Start library
if (!require(rootSolve)) install.packages("rootSolve")
library(rootSolve)
# If we set the two equations equal to each other.
# x^2 - 2x - 2 = x + 2 --> x^2 - 3x - 4 = 0
# Function polyroot requires a vector of polynomial coefficients in increasing order
v_coefficient <- c(-4, -3, 1)
ans <- polyroot(v_coefficient)
print(paste0("The equations equal to each other at: ", round(ans,3)))
## [1] "The equations equal to each other at: -1+0i"
## [2] "The equations equal to each other at: 4+0i"
To get the area between the two curves, \(\int_{-1}^{4} x + 2 dx - \int_{-1}^{4} x^2-2x-2dx\). We’ll work on each side individually and then combine the equation together to solve.
\[\int_{-1}^{4} x + 2 dx = \frac{x^2}{2} + 2x + C\] \[= \frac{16}{2} + 2*4 - (\frac{1}{2} +2*-1) = 8 + 8 - (\frac{1}{2} - 2) = 17.5\] \[\int_{-1}^{4} x^2-2x-2dx = \frac{x^3}{3} - x^2 - 2x + C\] \[= \frac{64}{3} - 16 - 2*4 - (\frac{-1}{3} - 1 - 2*-1) = -10/3\]
Now to put it together.
\[17.5 - \frac{-10}{3} = 20.83333\]
Let’s double check out work.
integrand <- function(x){x + 2 - (x**2 -2*x - 2)}
integrate(integrand, -1, 4)
## 20.83333 with absolute error < 2.3e-13
The solution to the area between the curves is: 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 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.
We will use the Economic Order Quantity Formula to solve this problem. Reference: http://www.dummies.com/business/accounting/cost-accounting-the-economic-order-quantity-formula/, https://en.wikipedia.org/wiki/Economic_order_quantity
The Economic Order Quantity (EOQ) is a decision tool used in cost accounting. It’s a formula that allows you to calculate the ideal quantity of inventory to order for a given product. The calculation is designed to minimize ordering and carrying costs.
The formula is as follows: \(Q = \sqrt{\frac{2DK}{H}}\), where Q is the economic order quantity (units), D is demand (units, often annual), K is ordering cost (per purchase order), and H is carrying cost per unit.
In case, if you are curious on how I got the above formula for the optimized Q, let’s look at the following equation:
\[TC = PD + \frac{DK}{Q} + \frac{hQ}{2}\]
Purchase Cost (PD): The variable cost of goods: purchase unit price * annual demand quantity.
Ordering Cost (\(\frac{DK}{Q}\)): Cost of placing orders: each order has a fixed cost K, and we need to order D/Q times per year, where D is the annual demand quantity and Q is the order quantity.
Holding cost (\(\frac{hQ}{2}\)): Average quantity in stock (between fully replenished and empty) is \(\frac{Q}{2}\).
To optomize the TC (or total costs), we need to differentiate this equation and find the critical values.
\[0 = \frac{-DK}{Q^2} + \frac{h}{2}\]
If we solve for Q, we get the Economic Order Quantity formula that optimizes the ordering amount Q.
\[ Q = \sqrt{\frac{2DK}{h}}\]
Let’s plug these values in R in order to obtain the optimal ordering amount.
K <- 8.25
H <- 3.75
D <- 110
EOQ <- function(S,H,D){
return(sqrt(2*D*S/H))
}
print(paste0("Number of orders per year that will minimize inventory costs: ", EOQ(K,H,D)))
## [1] "Number of orders per year that will minimize inventory costs: 22"
6. Use integration by parts to solve the integral below.
\[\int ln(9x)x^6dx\]
The formula for integration by parts is:
\[\int f(x) * g'(x) dx = f(x)g(x) - \int f'(x)g(x)dx\]
Let’s set \(f(x) = ln(9x)\) and \(g'(x) = x^6\). Therefore, \(f'(x) = \frac{9}{9x} = \frac{1}{x}\) and \(g(x) = \frac{x^7}{7}\).
\[\int ln(9x) * x^6 dx = ln(9x) \frac{x^7}{7} - \int \frac{1}{x} *\frac{x^7}{7} dx = ln(9x) \frac{x^7}{7} - \int \frac{x^6}{7} dx = ln(9x) \frac{x^7}{7} - \frac{x^7}{49} + C\]
The solution to this problem is: \(ln(9x) \frac{x^7}{7} - \frac{x^7}{49} + C\)
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}\]
\(f(x)\) is a probability density function if the integral of \(f(x) = 1\). (The cumulative probability should always be 100%, if we recalled from the probability portion of CUNY 605).
\[\int_{1}^{e^6} \frac{1}{6x}dx = \frac{1}{6}*ln(x)\] \[= \frac{1}{6} * ln(e^6) - \frac{1}{6}*ln(1) = 1\]
So yes, this function is a probability density function.