1. Simplify the following expression. (( 64x . (y^(−2)) / ( x^(−2) . y ))^(−1/2). Write the solution using rational exponents.

((64*x * y^(−2)/(x^(−2) * y))^(−1/2) = (4*x/y)^(-3/2)

2. If f (x) = √(x + 5) and g(x) = 3/x, find f (x) · g(x).

f<-function(x){(x+5)^(1/2)}
g<-function(x){(3/x)}

multiply=function(f,g){
 function(x){f(x)*g(x)}
}
h=multiply(f,g)
h(4)
## [1] 2.25

3. Find the break-even point(s) for the revenue and cost functions below. R(x) = 24.2x + 0.2x^2, C(x) = 13*x + 147

break-even points: R(x) = C(x) <=> R(x)-C(x) = 0

=> R(x)-C(x) = 24.2x + 0.2x^2 - 13x - 147 => R(x)-C(x) = 0.2x^2 + 11.2x -147

quadratic equation: 0.2x^2 + 11.2*x -147 = 0 , (a,b,c) = (0.2,11.2,-147)

fact_quad_eqt <- function(a,b,c){
  if(discr(a,b,c)==0) {
    return(list(x=-b/(2*a)))
  } else if(discr(a,b,c)>0) {
      return(list(x1=(-b+sqrt(discr(a,b,c)))/(2*a), x2=(-b-sqrt(discr(a,b,c)))/(2*a)))
  } else {
      return("no roots.")
  }
}
discr <- function(a,b,c) {
  return((b*b)-(4*a*c))
}

fact_quad_eqt(0.2,11.2,-147)
## $x1
## [1] 10.97435
## 
## $x2
## [1] -66.97435

4. Find the derivative for the following function. y = 9*x^(8.2)

library(Deriv)
f=function(x){9*x^(8.2)}
Deriv(f)
## function (x) 
## 73.8 * x^7.2

5. Find the derivative for f(x) = -4x^5 -3x^4 -4*x^3 -3

library(Deriv)
f=function(x){-4*x^5 -3*x^4 -4*x^3 -3}
Deriv(f)
## function (x) 
## -(x^2 * (3 * (4 + x * (3 + 4 * x)) + x * (3 + 8 * x)))

6. A pole that is 4264 feet long is leaning against a building. The bottom of the pole is moving away from the wall at a rate of 2 ft./sec. How fast is the top of the pole moving down the wall when the top is 3480 feet off the ground?

Let’s use Pythagoras theory: a^2 + b^2 = c^2

at time = 0: a^2 + b^2 = (4264)^2 => b = [(4264)^2 - (3480)^2]^(1/2) = 2464 feet

at moving down: 2a(da/dt) + 2b(db/dt) = 0 => given_speed = (da/dt) = -(b/a)*(db/dt)

# a=3480, b=2464, given_speed=2 ft/sec
speed=function(a,b,given_speed){
  return(-(b/a)*given_speed)
}

speed(3480,2464,2)
## [1] -1.416092

7. Use the Product Rule or Quotient Rule to find the derivative. f(x)=(3x^8 −x^5)/(2x^8 +2)

f<-function(x){(3*x^8 -x^5)/(2*x^8 +2)}

# f=g/h  =>  f'= (h*g'-h'*g)/h^2
library(Deriv)
answer<-Deriv(f)
answer
## function (x) 
## {
##     .e1 <- x^8
##     .e3 <- 2 + 2 * .e1
##     .e4 <- x^3
##     x^4 * ((3 * .e4 - 1) * (5 - 16 * (.e1/.e3)) + 9 * .e4)/.e3
## }

8. Consider the function: f (x) = 4x + 25x−1

Step 1. Find the critical values of the function.

Step 2. Use the First Derivative Test to find any local extrema. Write any local extrema as an ordered pair.

Step 1:

f<-function(x){4*x + 25*x^(-1)}
answer<-Deriv(f)
answer
## function (x) 
## 4 - 25/x^2

Critical values are (0 and 5/2): f’(0) = infinity or undefined, f’(x)=0 => x=5/2.

Step 2:

#f<-function(x) 4*(5/2) + 25*(5/2)^(-1)
f<-function(x){4*x + 25*x^(-1)}
f(5/2)
## [1] 20

The local extrema as an ordered pair is (5/2, 20).

9. Evaluate dy/dx at x = 1 for the function below. y = −9u^2 + 7u + 4, where u = −3x^3 + 3x + 6

y<-function(x){-9*(-3*x^3 + 3*x + 6)^2 + 7*(-3*x^3 + 3*x + 6) + 4}
# y' = dy/dx = (dy/du)*(du/dx) = (-18*u + 7)*(-9*x^2 + 3) = (-18*(−3*x^3 + 3*x + 6) + 7)*(-9*x^2 + 3) = (54*x^3 - 54*x -108 + 7)*(-9*x^2 + 3) = (54*x^3 - 54*x -101)*(-9*x^2 + 3)
# y'(1) = 606
a<-Deriv(y)
a(1)
## [1] 606

10. Consider the following function: f(x) = (x + 5)*(x + 4)^2

Step 1. Determine f´(x) and f´´(x)
Step 2. Determine where the function is increasing and decreasing. Write your answers in interval notation.
Step 3. Determine where the function is concave up and concave down. Write your answers in interval notation.
Step 4. Find the x-values of any local minima, maxima, and inflection points.

Step 1:

library(Deriv)
f<-function(x){(x + 5)*(x + 4)^2}
f(-4)
## [1] 0
f(-13/3)
## [1] 0.07407407
deriv1=Deriv(f)
deriv1
## function (x) 
## (2 * (5 + x) + 4 + x) * (4 + x)
deriv2=Deriv(deriv1)
deriv2
## function (x) 
## 2 * (5 + x) + 3 * (4 + x) + 4 + x

Step 2:

f'(x) = (2 * (5 + x) + 4 + x) * (4 + x) = (10+2x+4+x)*(4+x) = (14+3x)(4+x) = 56 + 26x + 3x^2
56 + 26x + 3x^2 = 0 => x = -14/3, x = -4
Intervals are: 
1) x < -14/3      => f'(-5) = 1 > 0      => increasing
2) -14/3 < x < -4 => f'(-9/2) = -1/4 < 0 => decreasing
3) x > -4         => f'(-3) = 5 > 0      => increasing

Step 3:

f''(x) = 2 * (5 + x) + 3 * (4 + x) + 4 + x = 10+2x+12+3x+4+x = 6x+26 = 2(3x+13)
x = -13/3
At intervals: 
1) f''(x) < 0 f(x) concave down
2) f''(x) > 0 f(x) concave up

Step 4:

f(-14/3) = 4/27 => (-14/3, 4/27) local maxima
f(-4) = 0       => (-4, 0) local minima
f(-13/3) = 2/27 => (-13/3, 2/27) inflection point

11. Consider the function: f (x) = −7x2 − 84x − 140

Step 1. Find the second derivative of the given function.
Step 2. Use the Second Derivative Test to locate any local maximum or minimum points in the graph of the given function. Express your answer(s) as ordered pairs.

Step 1:

f<-function(x){-7*x^2-84*x-140}
deriv1<-Deriv(f)
deriv1
## function (x) 
## -(14 * x + 84)
deriv2<-Deriv(deriv1)
deriv2
## function (x) 
## -14
f(-6)
## [1] 112

Step 2:

f'(x) = -(14 * x + 84) => -(14 * x + 84)=0 => x=-6 < 0 => f(-6) = 112 => (-6,112) maximum point
f"(x) < 0 => 2nd derivative always negative it means f(x) is concave down

12. A beauty supply store expects to sell 100 flat irons during the next year. It costs $1.20 to store one flat iron for one year. There is a fixed cost of $15 for each order. Find the lot size and the number of orders per year that will minimize inventory costs.

Let x = number of orders per year ls = lot size = 100/x f(x) = ls . (1.60) + x . 15 = 160/x + 15x

f<-function(x){160/x + 15*x}
deriv1<-Deriv(f)
deriv1
## function (x) 
## 15 - 160/x^2
deriv2<-Deriv(deriv1)
deriv2
## function (x) 
## 320/x^3
f(3.26)
## [1] 97.97975

f’(x) = deriv1 = 0 => 15 - 160/x^2 = 0 => x = (160/15)^(1/2) => x = 3.26 and x = -3.26 => accept only positive number of orders => x = 3.26

f“(x) = deriv2 = 320/x^3 => f”(3.26) = 9.24 > 0 minimal point

f(3.26) = 98 => x = 3 (rounded number of orders)

The beauty supply store will minimize the inventory costs with: x = number of orders per year = 3, ls = lot size = 100/x = 100/3 = 33 items per lot

13. Find the derivative of the given expression. y = 18*x/ln(x^4)

y<-function(x){18*x/log(x^4)}
dy<-Deriv(y)
dy
## function (x) 
## {
##     .e1 <- 4 * log(x)
##     18 * 1/.e1 - 72/.e1^2
## }

14. Consider the following function: f(x) = -5x^3e^x

Step 1. Find the first derivative of the above function. 

Step 2. Find the second derivative of the above function.

f<-function(x){-5*x^3*e^x}
#Step1:
#-----
deriv1<-Deriv(f)
deriv1
## function (x) 
## {
##     .e1 <- e^x
##     -(5 * (x^2 * (3 * .e1 + .e1 * x * log(e))))
## }
#Step2:
#-----
deriv2<-Deriv(deriv1)
deriv2
## function (x) 
## {
##     .e1 <- e^x
##     .e2 <- log(e)
##     .e4 <- .e1 * x * .e2
##     -(5 * (x * ((2 * .e1 + .e4) * (3 + x * .e2) + .e4)))
## }

15. Evaluate the definite integral below. Write your answer in exact form or rounded to two decimal

1

places. ∫(8(8x + 5)^(2/3))dx

-3

f<-function(x){8*((8*x + 5)^(2))^(1/3)}
integrate(Vectorize(f), lower = -3, upper = 1)
## 124.2966 with absolute error < 0.002
integrate
## function (f, lower, upper, ..., subdivisions = 100L, rel.tol = .Machine$double.eps^0.25, 
##     abs.tol = rel.tol, stop.on.error = TRUE, keep.xy = FALSE, 
##     aux = NULL) 
## {
##     f <- match.fun(f)
##     ff <- function(x) f(x, ...)
##     limit <- as.integer(subdivisions)
##     if (limit < 1L || (abs.tol <= 0 && rel.tol < max(50 * .Machine$double.eps, 
##         5e-29))) 
##         stop("invalid parameter values")
##     if (is.finite(lower) && is.finite(upper)) {
##         wk <- .External(C_call_dqags, ff, rho = environment(), 
##             as.double(lower), as.double(upper), as.double(abs.tol), 
##             as.double(rel.tol), limit = limit)
##     }
##     else {
##         if (anyNA(lower) || anyNA(upper)) 
##             stop("a limit is NA or NaN")
##         if (is.finite(lower)) {
##             inf <- 1L
##             bound <- lower
##         }
##         else if (is.finite(upper)) {
##             inf <- -1L
##             bound <- upper
##         }
##         else {
##             inf <- 2L
##             bound <- 0
##         }
##         wk <- .External(C_call_dqagi, ff, rho = environment(), 
##             as.double(bound), inf, as.double(abs.tol), as.double(rel.tol), 
##             limit = limit)
##     }
##     res <- wk[c("value", "abs.error", "subdivisions")]
##     res$message <- switch(wk$ierr + 1L, "OK", "maximum number of subdivisions reached", 
##         "roundoff error was detected", "extremely bad integrand behaviour", 
##         "roundoff error is detected in the extrapolation table", 
##         "the integral is probably divergent", "the input is invalid")
##     if (wk$ierr == 6L || (wk$ierr > 0L && stop.on.error)) 
##         stop(res$message)
##     res$call <- match.call()
##     class(res) <- "integrate"
##     res
## }
## <bytecode: 0x7ff8327a6358>
## <environment: namespace:stats>

16. Solve the differential equation given below. dy/dx = -4(-3 - y) = 4(3+y)

dy/dx = 4*(3+y)
dy/(3+y) = 4*dx
∫dy/(3+y) = ∫4*dx
ln|3+y| = 4x + C, where C=constant
3+y = +- e^(4x+C)
y = C'e^4x - 3, where C'= + or - constant

17. The marginal cost of a product is given by 238 + 298/√x dollars per unit, where x is the number of units produced. The current level of production is 137 units weekly. If the level of production is increased to 232 units weekly, find the increase in the total costs. Round your answer to the nearest cent.

f<-function(x){(238+(298/sqrt(x)))*x}
#f(137)
#f(232)
#(f(232)-f(137))/(232-137)
deriv1<-Deriv(f)
#deriv1
deriv1(137)
## [1] 250.7299
deriv1(232)
## [1] 247.7823
deriv1(232)-deriv1(137)
## [1] -2.9476

If the production increases from 137 to 232 units weekly, there’s a decrease of 3 dollars per unit.

18. Find the Taylor polynomial of degree 5 near x = 1 for the following function. y = √(4x − 3)

f<-function(x){sqrt(4*x-3)}
deriv1<-Deriv(f)
deriv2<-Deriv(deriv1)
deriv3<-Deriv(deriv2)
deriv4<-Deriv(deriv3)
deriv5<-Deriv(deriv4)
f(1)
## [1] 1
#deriv1
deriv1(1)
## [1] 2
#deriv2
deriv2(1)
## [1] -4
#deriv3
deriv3(1)
## [1] 24
#deriv4
deriv4(1)
## [1] -240
#deriv5
deriv5(1)
## [1] 3360

Taylor polynomial:

T(x) = f(1) + deriv1(1)(x-1) + (deriv2(1)(x-1)^2)/2! + (deriv3(1)(x-1)^3)/3! + (deriv4(1)(x-1)^4)/4! + (deriv5(1)(x-1)^5)/5!

T(x) = 1 + 2(x-1) - (4(x-1)^2)/2 + (24(x-1)^3)/6 - (240(x-1)^4)/24 + (3360(x-1)^5)/120