Doll Buy Price = 10

Doll Sell Price = x

Profit = x-10

Sold in a week = 80-2x

Week Profit=\[x(80-2x)-10(80-2x)\] \[f(x)=80x-2x^2-800+20x\] Simplified: \[f(x)=-2x^2+100x-800\]

  1. \[f(x)=8x^3+7x^2-5\]
f <- function(x){
  return((8*x^3)+(7*x^2)-5)
}

Step 1:

f(3)
## [1] 274

Step 2:

f(-2)
## [1] -41

Step 3: \[f(x+c)=8(x+c)^3+7(x+c)^2-5\] \[f(x+c)=8x^3+8c^3+7x^2+7c^2+24cx^2+24c^2x+14cx-5\] 3. Step 1: As x approaches 1 from the left the value of the function gets closer to 2. Therefore the limit is 2.

Step 2: As x approaches 1 from the right the value of the function gets closer to -5. Therefore the limit is -5.

Step 3: The limit from the left doesn’t equal the limit from the rigt. Therefore the limit does not exist.

library(Deriv) 
## Warning: package 'Deriv' was built under R version 3.3.3
f <- function(x){-2*x^3}
Deriv(f)
## function (x) 
## -(6 * x^2)
library(Deriv) 
f <- function(x){-8/x^2}
Deriv(f)
## function (x) 
## 16/x^3
library(Deriv) 
g <- function(x){5*x^(1/3)}
Deriv(g)
## function (x) 
## 1.66666666666667/x^0.666666666666667
library(Deriv) 
y <- function(x){-2*x^(9/8)}
Deriv(y)
## function (x) 
## -(2.25 * x^0.125)
  1. When x=0 y=40 and when x=4 y=35

Rate of change=\[m=\frac{y_2 - y_1}{x_2 -x_1}\] \[m=\frac{35-40}{4-0}\] \[m=\frac{-5}{4}\] 9. \[C(x) = 630 + 2.4x\] \[A(x)= \frac{630 + 2.4x}{x}\]

library(Deriv) 
f=function(x) {(-2 * x^-2 + 1) *(-5 * x + 9)}
Deriv(f)
## function (x) 
## 4 * ((9 - 5 * x)/x^3) - 5 * (1 - 2/x^2)
library(Deriv) 
f=function(x) {((5*x^.5) + 7)/((-x^3) + 1)}
Deriv(f)
## function (x) 
## {
##     .e1 <- 1 - x^3
##     .e2 <- sqrt(x)
##     (2.5/.e2 + 3 * (x^2 * (5 * .e2 + 7)/.e1))/.e1
## }
library(Deriv) 
f=function(x) {(3 * x^(-3) -8 * x + 6)^(4/3)}
Deriv(f)
## function (x) 
## -(1.33333333333333 * ((3/x^3 + 6 - 8 * x)^0.333333333333333 * 
##     (8 + 9/x^4)))
f <- function(t){return(round((550 * t^2)/((t^2 + 15)^(1/2)),0))}
f(3)
## [1] 1010
  1. Step 1:
N <- function(t){return(round(1000 * (6 + 0.1 * t)^(1/2),0))}
N(3)
## [1] 2510

Step 2:

library(Deriv) 
N <- function(t){1000 * (6 + 0.1 * t)^(1/2)}
N1 <- Deriv(N) 
round(N1(5),0)
## [1] 20
# The first derivative is positive showing that the attendance is increaseing
  1. Step 1: \[\frac{d_y}{d_x} = \frac{-9x^2}{12y^2}\] Step 2: \[(3,-1) = \frac{-81}{12} = -6.75\]
library(Deriv)
f <- function(x){(x+3)/(x-8)}
f1 <- Deriv(f)
f1(7)
## [1] -11
f1(9)
## [1] -11
f1(8)
## [1] -Inf

The first derivative shows that the function will be decreasing for values greater and less than 8 since the results are negative. At 8 the function is undefined since it will be dividing by 0.

  1. Step 1:
library(Deriv)
f <- function(t){14 + ((367*t^2)/(t^2 + 100) )}
f1 <- Deriv(f)
f2 <- Deriv(f1)
f1(0)
## [1] 0
f2(0)
## [1] 7.34

The first derivative of F is equal to 0 when t=0. Knowing that, we make t=0 in the second derivative of F and get a postive number. Therefore 0 is the min. Meaning that the temperature is increasing when t>0 and decreasing when t<0.

Step 2:

f <- function(t){14 + ((367*t^2)/(t^2 + 100))}
f(10000)
## [1] 380.9996
f(1000000)
## [1] 381
f(1000000000)
## [1] 381

Getting the limit as f approaches infinity we see that the pizza is approaching 381 degrees over time.

library(Deriv)
f <- function(x){(x^3 / 3340000) - (7*x^2 / 9475) + (42417727*x / 1265860000) + (1/33)}
f1 <- Deriv(f)
uniroot(f1,lower=1,upper=30)
## $root
## [1] 22.99999
## 
## $f.root
## [1] 1.628038e-08
## 
## $iter
## [1] 3
## 
## $init.it
## [1] NA
## 
## $estim.prec
## [1] 6.103516e-05
f2 <- Deriv(f1)
f2(23)
## [1] -0.001436255
f(23)
## [1] 0.4138353

Solving for x in the first derivative of f we get 23. Using 23 in the second derivative we get a negative number showing that 23 is the max. f(23)=.41

This shows that the most packages were .41 million and were delivered on Nov 23.

library(Deriv)
f <- function(x){7*x^2 + 28*x - 35}
f1 <- Deriv(f) 
f2 <- Deriv(f1)
f2(-2)
## [1] 14
f(-2)
## [1] -63

Solving for f’(x) = 0 we get x=-2. With f’’(-2)=14 we know that f(-2)=-63 will be the min. Min: (-2,-63)

library(Deriv)
f <- function(x){-6*x^3 + 27*x^2 + 180*x}
f1 <- Deriv(f) 
f1
## function (x) 
## 180 + x * (54 - 18 * x)
f2 <- Deriv(f1)
f2(-2)
## [1] 126
f2(5)
## [1] -126
f(-2)
## [1] -204
f(5)
## [1] 825

Solving f’(x)=0 we get x=-2 and x=5. f’‘(-2)>0 so f(-2) is the min and f’’(5)<0 so f(5) is the max Max: (5,825) Min: (-2,-204)

library(Deriv)
f <- function(x){(120/x)*1.6 + x * (6 + (4.5 * (120/x)))}
f1 <- Deriv(f) 
f1
## function (x) 
## 6 - 192/x^2
f2 <- Deriv(f1)
f2
## function (x) 
## 384/x^3
f2(sqrt(32))
## [1] 2.12132

We make f(x) to determine what the total fees are with storage and reorder. f’(x)=0 when x=sqrt(32). f’’(sqrt(32))>0 so sqrt(32) will be f(x)’s min. Meaning that 6 (sqrt(32)) orders should be placed per year with a lot size of 20 (120/6).

library(Deriv)
f <- function(x){(221184/x) + 8*x^2}
f1 <- Deriv(f) 
f1
## function (x) 
## 16 * x - 221184/x^2
f1(24)
## [1] 0
f2 <- Deriv(f1)
f2
## function (x) 
## 16 + 442368/x^3
f2(24)
## [1] 48

Using the volume and dimensions a rectangle we are able to come up with f(x). f’(x)=0 when x=24 and f’’(24) is positive making x=24 the min. Using volume = x^2*y we get y=32. The dimensions for minimal cost are x=24 and y=32.

library(Deriv)
f <- function(x){52.8*x + 30412.8/x}
f1 <- Deriv(f) 
f1
## function (x) 
## 52.8 - 30412.8/x^2
f1(24)
## [1] 0
f2 <- Deriv(f1)
f2
## function (x) 
## 60825.6/x^3
f2(24)
## [1] 4.4

Using the volume and dimensions a rectangle we are able to come up with f(x). f’(x)=0 when x=24 and f’’(24) is positive making x=24 the min. Using area = x*y we get y=44. The dimensions for minimal cost are x=24 and y=32.

f <- function(x){67000*(37/67)^(x/7)}
f(16)
## [1] 17244.5

Using the exponential function we can determine the price 16 years from purchase. It will be worth $17,244.50

library(Deriv)
f <- function(x){23.2*x - .4*x^2}
f1 <- Deriv(f) 
f1
## function (x) 
## 23.2 - 0.8 * x
f1(29)
## [1] -3.552714e-15
f2 <- Deriv(f1)
f2
## function (x) 
## -0.8
f2(29)
## [1] -0.8

Revenue = units * price. Using the second derivative method we see that revenue is maximized at 29 units.

f <- function(x){400*(426.8/400)^(x/11)}
round(f(22),2)
## [1] 455.4

Using the exponential formula we see that cost will be $455.40 on Jan 1, 2017

  1. Step 1: \[P(x)=380x−2x^2+C\] \[1700=380(38)−2(38)^2+C\] \[C=−9852\] \[P(x)=380x−2x^2-9852\] Step 2:
P <- function(x) {380*x - 2*x^2 - 9852}
P(56)
## [1] 5156

The proft from 56 units will be $5156

  1. \[u = ln(y)\]
    \[\frac{du}{dy} = \frac{1}{y}\] \[-5\int u^3 du = \frac{-5}{4}u^4 +C\] Final Ans: \[\frac{-5}{4}ln(y)^4 +C\]

P <- function(t) {75 * t - 6 * t^1.5}
P(9) - P(0)
## [1] 513
library(mosaic)
## Warning: package 'mosaic' was built under R version 3.3.3
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: lattice
## Loading required package: ggplot2
## Loading required package: mosaicData
## Warning: package 'mosaicData' was built under R version 3.3.3
## Loading required package: Matrix
## 
## The 'mosaic' package masks several functions from core packages in order to add additional features.  
## The original behavior of these functions should not be affected by this.
## 
## Attaching package: 'mosaic'
## The following object is masked from 'package:Matrix':
## 
##     mean
## The following objects are masked from 'package:dplyr':
## 
##     count, do, tally
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cov, D, fivenum, IQR, median, prop.test,
##     quantile, sd, t.test, var
## The following objects are masked from 'package:base':
## 
##     max, mean, min, prod, range, sample, sum
fun1 <- function(x) 6*x^2
fun2 <- function(x) 6*sqrt(x)
plot (fun1, -2, 2)
plot (fun2, -2, 2, add=TRUE)
## Warning in sqrt(x): NaNs produced

integrate(fun2,0,1) 
## 4 with absolute error < 0.00046
integrate(fun1,0,1)
## 2 with absolute error < 2.2e-14

Ans: Area of the region is 2

  1. \[dy = x^3ydx\] \[\frac{dy}{y} = x^3dx\] \[\int \frac{dy}{y} = \int x^3dx\] \[ln(y) + C = \frac{1}{4}x^4 +C\] \[y = e^\frac{x^4}{4}+C\]
library(mosaic)
f <- function(x)(x*sqrt(x+7))
integrate(f,-7,2)
## -28.8 with absolute error < 6.1e-08

Answer: -28.8 or -144/5

  1. Step 1: \[46+\sum\limits_{n=1}^{20}46*.22^x\]
Summation <- function(Num)
{
  Result <- 0
  for (x in 1:Num) 
  {
    Result <- Result + (46 * .22^x)
  }
  print(Result) 
}

Summation(20)
## [1] 12.97436

Distance traveled = 46 + 12.97 = 58.97

Step 2: \[46+\sum\limits_{n=1}^{\infty}46*.22^x\]

Summation(10000000)
## [1] 12.97436

Distance traveled = 46 + 12.97 = 58.97

  1. \[\frac{d}{dx}5e^{x-3} = 5e^{x-3}\]

\[Taylor series = 5e^{-3} + 5e^{-3}x + \frac{5}{2}e^{-3}x^{2} + \frac{5}{6}e^{-3}x^{3} + \frac{5}{24}e^{-3}x^{4} + \frac{5}{120}e^{-3}x^{5}\]

Linear Algebra

A <- matrix(c(1,2,-1,2,1,1,-3,-3,2),3,3)
A
##      [,1] [,2] [,3]
## [1,]    1    2   -3
## [2,]    2    1   -3
## [3,]   -1    1    2
solve(A)
##            [,1]      [,2] [,3]
## [1,] -0.8333333 1.1666667  0.5
## [2,]  0.1666667 0.1666667  0.5
## [3,] -0.5000000 0.5000000  0.5
A <- matrix(c(1,2,-1,2,1,1,-3,-3,2),3,3)
A
##      [,1] [,2] [,3]
## [1,]    1    2   -3
## [2,]    2    1   -3
## [3,]   -1    1    2
B <- matrix(c(5,13,-8),3,1)
B
##      [,1]
## [1,]    5
## [2,]   13
## [3,]   -8
X <- solve(A)%*%B
X
##      [,1]
## [1,]    7
## [2,]   -1
## [3,]    0

c,

A <- matrix(c(5,13,-8,2,1,1,-3,-3,2),3,3)
A
##      [,1] [,2] [,3]
## [1,]    5    2   -3
## [2,]   13    1   -3
## [3,]   -8    1    2
B <- matrix(c(5,13,-8),3,1)
B
##      [,1]
## [1,]    5
## [2,]   13
## [3,]   -8
X <- round(solve(A) %*% B,0)
X
##      [,1]
## [1,]    1
## [2,]    0
## [3,]    0
q=matrix(c(3,1,4,4,3,3,2,3,2),nrow=3)
b=c(1,4,5)
x <- matrix(c(1,4,5,4,3,3,2,3,2),nrow=3)
y <- matrix(c(3,1,4,1,4,5,2,3,2),nrow=3)
z <- matrix(c(3,1,4,4,3,3,1,4,5),nrow=3)
final <- c(det(x)/det(q),det(y)/det(q),det(z)/det(q))
final
## [1]  1.461538 -2.538462  3.384615