library(knitr)
1. Use integration by substitution to solve the integral below.

\[ \int 4e^{-7x}dx \] \[ u=-7x\ \rightarrow du=-7dx\ \rightarrow dx=\frac{du}{-7} \] thus \[ \int 4e^{u}\frac{du}{-7} \rightarrow \frac{4}{-7} \int e^{u}du\rightarrow \frac{4}{-7} e^{u}+C \] finally \[ \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 6530 bacteria per cubic
centimeter.

\[ dN=(-\frac{3150}{t^{4}} -220)dt\rightarrow N=\int -\frac{3150}{t^{4}} -220dt\rightarrow N=\int -\frac{3150}{t^{4}} dt-\int 22dt\rightarrow N=-\frac{3150}{3t^{3}} -220t+C\]

t <- 1
(N <- (-3150/(3*t^3)-(220*1)))
## [1] -1270
(C <- 6530 - N )
## [1] 7800

Contamination = 7800

(3) Find the total area of the red rectangles in the figure below, where the equation of the line is f(x) = 2x-9.
plot_area_img <- "/Users/Audiorunner13/CUNY MSDS Course Work/DATA605 Fall 2022/Week 13/plot_area.png"
# attr(transplant_prop_img, "info")
include_graphics(plot_area_img)

\[ \int^{8.5}_{4.5} 2x-9dx=[x^{2}-9x]\mid^{8.5}_{4.5} \]

x1 <- 8.5
x2 <- 4.5
(pArea <- (x1^2-(9*x1))-(x2^2-(9*x2)))
## [1] 16

Area = 16

(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, lwd = 2, xlim=c(-5, 5))
curve(x+2, lwd = 2, xlim=c(-5, 5), add = TRUE)

Intersects at x = -1 and x = 4

\[ \int^{4}_{-1} x+2dx-\int^{4}_{-1} x^{2}-2x-2dx=-[\frac{1}{3} x^{3}-\frac{3}{2} x^{2}-4x]\mid^{4}_{-1} \]

(pArea <- 18.67 + 2.12)
## [1] 20.79
Area = 20.79
(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.

I could not figure this one out. :-(

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

\[ \int ln(9x)\times x^{6}dx \] \[ u=ln(9x),\frac{dv}{dx} =x^{6}\rightarrow du=\frac{9}{9x} dx=\frac{1}{x} dx\rightarrow dv=x^{6}dx \] \[ v=\frac{1}{7} x^{7} \] thus

\[ \int udv=uv-\int vdu\ =\ ln(9x)\frac{1}{7} x^{7}-\int \frac{1}{7} x^{7}\frac{1}{x} dx\ =\ 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} \]

\[ \int^{e^{6}}_{1} f(x)dx=\int^{e^{6}}_{1} \frac{1}{6x} dx=\frac{1}{6} \int^{e^{6}}_{1} \frac{1}{x} dx=\frac{1}{6} ln(x)\mid^{e^{6}}_{1} \]

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