library(tidyverse)

Question 1.

Use integration by substitution to solve the integral below:

\(\int4e^{-7x} dx\)

\[ =\int4e^{-7x} dx\\ = 4\int e^{-7x}dx\\ Substitute \ u = -7x, \ \ du=-7 dx \rightarrow dx=-\frac{1}{7}du\\ =-\frac{4}{7}\int e^udu\\ =-\frac{4e^u}{7} + C \]

Question 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 6530 bacteria per cubic centimeter.

The function \(N(t)\) can be derived by taking the integral of the changing rate:

\[ \begin{aligned} \int \frac{dN}{dt} &= \int -\frac{3150}{t^4}-220 \ dt\\ &= -3150\int \frac{1}{t^4} - 220 \ dt\\ &= -3150 \int t^{-4} -220 \ dt\\ &= -3150 \frac{t^{-3}}{-3} - 220t + C\\ &= 1050 t^{-3} - 220t + C \end{aligned} \]

Estimate level of contamination for \(6530 = N(1)\) \[ \begin{aligned} 6530 = \frac{1050}{1^3} - 220(1) + C\\ 6530 - 830 = C\\ 5700 = C \end{aligned} \]

Question 3.

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

From the looks of the graph, the upper bound would be 8.5 and the lower bound 4.5. Each rectangle has a width of 1 \(\rightarrow (8.5 - 4.5) / 4 = 1\).

Since the area of a rectangle is \(height \times width\) then the solution goes as follows:

Rectangle 1: \(1 \times 1 = 1\)

Rectangle 2: \(3 \times 1 = 3\)

Rectangle 3: \(5 \times 1 = 5\)

Rectangle 4: \(7 \times 1 = 7\)

Sum up the areas: \(1 + 3 + 5 + 7 = 16\)

Using R….

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

Question 4.

Find the area of the region bounded by the graphs of the given equations:

\(y = x^2 - 2x - 2, \ \ y= x + 2\)

curve(x^2-2*x-2, -3, 5, col = "red")
curve(x+2, add = TRUE, col = "blue")

Based on the graph we can see that two curves intersect at -1 and 4 which will be the lower and upper bounds respectively. Larger (left) function seems to be blue with \(x + 2\) and the smaller (right) function is red with \(x^2 - 2x - 2\). To find the area we’ll minus the smaller function from the larger function then integrate:

\[ \int_{-1}^{4} (x+2) - (x^2 - 2x - 2)\\ =\int_{-1}^{4} -x^2 + 3x + 4\\ \]

Using R to to find the area:

f <- function(x) {-x^2 + 3*x + 4}
integrate(f, lower = -1, upper = 4)
## 20.83333 with absolute error < 2.3e-13

Question 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.

Breakdown:

Fixed cost is \(8.75 \times (110 / x) = 907.5/x\)

Let us assume one third of their items remain at the end of the year. Storage cost is \(3.75 \times \frac{x}{3} = 1.25x\)

Cost = \(Fixed \ cost + Storage \ cost = 907.5/x + \frac{3.75x}{3}\)

cost <-expression((907.5 / x) + 1.25*x)
D(cost, 'x')
## 1.25 - 907.5/x^2

\(1.255 - 907.5/x^2\)

Solve for \(1.25 - 907.5/x^2= 0\)

\[ \begin{aligned} 1.25 = \frac{907.5}{x^2}\\ 1.25x^2 = 907.5\\ x^2 = \frac{907.5}{1.25}\\ x^2 = 726\\ x = \sqrt{726}\\ x = 26.94439\\\\ \therefore Lot \ Size = 27 \ and \\\ Number \ of \ Orders = 4.1 \end{aligned} \]

Question 6.

Use integration by parts to solve the integral below.

\(\int ln(9x). x^6dx\)

\[ u = ln(9x) \qquad v= \frac{x^7}{7}\\ du= \frac{1}{x} \qquad dv= x^6\\ \]

Using the method \[ \begin{aligned} \int u \ dv &= uv-\int v \ du\\ &=\frac{ln(9x)x^7}{7} - \int \frac{x^7}{7}. \frac{1}{x} \ dx\\ &= \frac{ln(9x)x^7}{7} - \int \frac{x^6}{7} dx\\ &= \frac{ln(9x)x^7}{7} - \frac{1}{7} \int x^6 dx\\ &= \frac{ln(9x)x^7}{7} - \frac{1}{7}.\frac{x^7}{7}\\ &= \frac{ln(9x)x^7}{7} - \frac{x^7}{49}\\ &= x^7\left(\frac{1}{7}ln(9x) - \frac{1}{49}\right) + C \end{aligned} \]

Question 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}\]

\[ \int\ \frac{1}{6x} \ dx\\ \frac{1}{6} \int \frac{1}{x} \ dx\\ \frac{1}{6}.ln(x) \ + C \]

Evaluating …

\[\frac{1}{6}.ln(e^6) - \frac{1}{6}.ln(1) = 1-0 = 1\]

So it is a probability density function since it satisfies the condition where \(\int_{-\infty}^{+\infty} f(x) \ dx = 1\)