R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

  1. \[ 4e^{-7x}dx\]

\[ \int4e^u dx ... u=-7x \] \[ \frac{du}{dx}=-7... dx=-\frac{1}{7}du \]

\[ \int 4e^u*-\frac{1}{7}du \]

\[-\frac{4}{7} \int e^u du \]

\[-\frac{4}{7}e^{-7x}+c \]

  1. bacteria in pond
  • get inital level

\[\int-3150t^{-4}-220\] \[-\int3150t^{-4}dt-\int220dt\]

\[\frac{3150}{3t^3}-220t+c= 6530\]

  • Evaluated at 1
6530-(3150/3-220)
## [1] 5700
  • \[ \frac{3150}{3t^3}-220t+5700\]

3

  • area of rectangle equals base(change(x)) * f(x)
  • total area=
    • delta(x)=1
    • 1(f(5))+ 1(f(6))+ 1(f(7))+ 1(f(8))
      • 16
my_area <- sum(sapply(c(5,6,7,8),function(x)2*x-9))
print(my_area)
## [1] 16

4

  • lets look at a plot of where equations are equal which is at x=-1,4
    • the area we want is the integral from -1,4 of both equations
    • As one of our integrals is below the x axis, our integral for the function under the x axis gives us the negative area between the x axis and the function. Therefore we need to add the negative of this integral to our other integral equation
      • 17.5 - -3.333= 20.8333
equation <- function(x) {x^2-2*x-2}
equation_2 <- function(x){x+2}
#plot(equation)
#lines(equation_2, col="blue")

total_1 <- integrate(equation,-1,4)
total_1
## -3.333333 with absolute error < 1.2e-13
total_2 <- integrate(equation_2,-1,4)
curve(equation, -1,4)
plot (equation_2, -2, 4, add=TRUE)

as.numeric(total_2[1])-as.numeric(total_1[1])
## [1] 20.83333
## Checks on integral to confirm critical points are included in function call
root_1 <- uniroot(equation,c(0,-1))[1]
root_2 <- uniroot(equation,c(0,4))[1]
a <- as.numeric(integrate(equation,-1,4)[1])
b <- as.numeric(integrate(equation,-1,-.732)[1])
c <- as.numeric(integrate(equation,-.732,4)[1])

c+b
## [1] -3.333333

5

  • let x= # irons per order
  • let o= orders
  • x*o=110
  • x= 110/o
  • cost= \(3.75*x+8.25(o)\)
  • cost= \(3.75x+ 907.5/x\)
  • cost’= \(3.75 - \frac{907.5}{x^2}\)
  • evaluate at 0
    • $ 3.75*x^2= 907.5 $
8.25*110
## [1] 907.5
sqrt(907.5/3.75)
## [1] 15.55635
  • 15.5 irons per order

6 integration by parts

  • \(ln(9x)*x^6dx\)
  • u= ln(9x)
  • du=1/x dx
  • dv= x^6
  • v= x^7/7
  • \(uv - \int vdu\)

\[ \frac {ln(9x)*x^7}{7}- \int x^6/7 \]

  • pull out constant and integrate vdu \[ \frac {ln(9x)*x^7}{7}- \frac {x^7}{49} + C \]

7

  • \(\int_{1}^{e^6} \frac{1}{6x}dx = 1\)
  • \(\frac{1}{6} ln(x)... x=e^6|1\ \)
  • \(\frac{1}{6}(6-0)==1\)