1. Simplify the following expression: \(\left(\frac{64xy^-2}{x^-2y} \right)^\left(-1/2\right)\)
library(Deriv)
exp <- expression(((64*x*y^-2)/(x^-2*y))^(-1/2))
Simplify(exp)
## expression(1/sqrt(64 * (x^3/y^3)))
  1. If \(\ f(x) = \sqrt{x + 5}\) and \(\ g(x) = 3/x\), find \(\ f(x) * g(x)\).
f <- function(x) sqrt(x + 5)
g <- function(x) 3/x

fxgx <- function(x) 3*sqrt(x+5)/x
  1. Find the break-even points(s) for the revenue and cost functions below. \(\ R(x) = 24.2x - 0.2x^2\) \(\ C(x) = 13x + 147\)
r <- function(x) { 24.2 * x - .2 * x ^ 2}
c <- function(x) { 13*x + 147}

be <- function(x) (24.2 * x - .2 * x ^ 2 - 13*x - 147) 
mosaic::findZeros(24.2 * x - .2 * x ^ 2 - 13*x - 147 ~ x)
##    x
## 1 21
## 2 35
  1. Find the derivative for the following function \(\ y = 9x^8.2\)
y = function(x) { 9*x^8.2 }
Deriv::Deriv(y)
## function (x) 
## 73.8 * x^7.2
  1. Find the derivative for \(\ f(x) = -4x^5 - 3x^4 -4x^3 -3\)
f = function(x) {-4*x^5 - 3*x^4 - 4*x^3 - 3}
Deriv::Deriv(f)
## function (x) 
## -(x^2 * (3 * (4 + x * (3 + 4 * x)) + x * (3 + 8 * x)))
  1. 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?
z <- 4264
dzdt <- 0

y <- 3480
#dydt <- ?

# 4264^2 = x^2 + 3480^2
x <- sqrt((4264^2) - (3480^2))
dxdt <- 2

# 4264*0 = x*2 + 3480(dydt)
dydt = (-x * 2)/3480
dydt
## [1] -1.416092
  1. Use the Product Rule of Quotient Rule to find the derivative. \(\ f(x) = \frac{3x^8 - x^5}{2x^8 + 2}\)
f = function(x) { (3*x^8 - x^5)/(2*x^8 + 2) }
Deriv::Deriv(f)
## function (x) 
## {
##     .e1 <- x^8
##     .e3 <- 2 + 2 * .e1
##     .e4 <- x^3
##     x^4 * ((3 * .e4 - 1) * (5 - 16 * (.e1/.e3)) + 9 * .e4)/.e3
## }
  1. Consider the function: \(\ f(x) = 4x + 25x^-1\)
    • Find the critical values of the function
f = function(x) { 4*x + 25*x^-1}
dfx = Deriv::Deriv(f)
mosaic::findZeros(dfx(x) ~ x)
##      x
## 1 -2.5
## 2  2.5
dfx(-3)
## [1] 1.222222
dfx(-1)
## [1] -21
dfx(3)
## [1] 1.222222
lMin = f(-2.5)
lMax = f(2.5)
  1. Evaluate \(\ dy/dx\) at $ x = 1$ for the function below: \(y = -9u^2 + 7u +4\) where \(u = -3x^3 + 3x + 6\)
f = function(x) {-9*(-3*x^3 + 3*x + 6)^2 + 7 * (-3*x^3 + 3*x + 6) + 4}
df = Deriv::Deriv(f)
df(1)
## [1] 606
  1. Consider the following function: \(f(x) = (x + 5)(x+4)^2\)
    • Determine \(f'(x)\) and \(f''(x)\)
    f = function(x) (x+5)*(x+4)^2
    oneD = Deriv::Deriv(f)
    twoD = Deriv::Deriv(oneD)
    
    oneD
    ## function (x) 
    ## (2 * (5 + x) + 4 + x) * (4 + x)
    twoD
    ## function (x) 
    ## 2 * (5 + x) + 3 * (4 + x) + 4 + x
    • Determine where the function is increasing and decreasing. Write your answers in interval notation.
    f = function(x) (x+5)*(x+4)^2
    df = Deriv::Deriv(f)
    mosaic::findZeros(df(x) ~ x)
    ##         x
    ## 1 -4.6666
    ## 2 -4.0000
    df(-5)
    ## [1] 1
    df(-4.5)
    ## [1] -0.25
    df(0)
    ## [1] 56
    #increasing: (-inf, -4.6666), (-4, inf)
    #decreasing: (-4.6666, -4)
    • Determine where the function is concave up and concave down. Write your answers in interval notation.
df2 = Deriv::Deriv(df)
    
mosaic::findZeros(df2(x) ~ x)
##         x
## 1 -4.3333
df2(-5)
## [1] -4
df2(0)
## [1] 26
#concave up: (-4.3333, inf)
#concave down: (-inf, -4.3333)
+ Find the x-values of any local minima, maxima, and inflection points.
mosaic::findZeros(df(x) ~ x)
##         x
## 1 -4.6666
## 2 -4.0000
lMin = f(-4)
lMax = f(-4.6666)
    
infPt = mosaic::findZeros(df2(x) ~ x)
infPt
##         x
## 1 -4.3333
  1. Consider the function: \(f(x) = -7x^2 - 84x - 140\)
f = function(x) -7*x^2 - 84*x - 140
df = Deriv::Deriv(f)
df2 = Deriv::Deriv(df)
df
## function (x) 
## -(14 * x + 84)
mosaic::findZeros(df(x) ~ x)
##    x
## 1 -6
mosaic::findZeros(df2(x) ~ x)
## Warning in mosaic::findZeros(df2(x) ~ x): No zeros found. You might try
## modifying your search window or increasing npts.
## numeric(0)
f(-6)
## [1] 112
#(-6, 112)
  1. 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.
invCost = function(x) (100/x * 1.2) + (x * (15 + 100/x))
dc = Deriv::Deriv(invCost)
mosaic::findZeros(dc(x) ~ x)
##         x
## 1 -2.8284
## 2  2.8284
invCost(2.8284)
## [1] 184.8528
invCost(3)
## [1] 185
lotSize <- 100/3
  1. Find the derivative of the given expression: \(y = \frac{18x}{ln(x^4)}\)
library("SciViews")
## Loading required package: MASS
f = function(x) { (18*x)/(ln(x^4))}
Deriv::Deriv(f)
## function (x) 
## {
##     .e1 <- ln(x^4)
##     18 * ((1 - 4/.e1)/.e1)
## }
  1. Consider the following function: \(f(x) = -5*x^3e^x\)
    • Find the first derivative of the above function
    f = function(x) { -5*x^3*e^x}
    first = Deriv::Deriv(f)
    second = Deriv::Deriv(first)
    first
    ## function (x) 
    ## {
    ##     .e1 <- e^x
    ##     -(5 * (x^2 * (3 * .e1 + .e1 * x * log(e))))
    ## }
    • Find the second derivative of the above function
    f = function(x) { -5*x^3*e^x}
    first = Deriv::Deriv(f)
    second = Deriv::Deriv(first)
    second
    ## function (x) 
    ## {
    ##     .e1 <- e^x
    ##     .e2 <- log(e)
    ##     .e4 <- .e1 * x * .e2
    ##     -(5 * (x * ((2 * .e1 + .e4) * (3 + x * .e2) + .e4)))
    ## }
  2. Evaluate the definite integral below. Write your answer in exact form or rounded to two decimal places. \[\int_{-3}^{1} 8^3\sqrt{(8x + 5)^2} dx\]
f = function(x) sqrt((8*x + 5)^2)
integrate(Vectorize(f), -3, 1)
## 33.125 with absolute error < 3.7e-13
  1. Solve the differential equation given below. \(dy/dx = -4(-3 - y)\)
dydx = function(y) 12 + 4*y
y = function(x) e^(4*x) - 3
  1. The marginal cost of a product is given by \(238 + \frac{298}{\sqrt{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.
mCost = function(x) 238 + (298/sqrt(x))
tCost = function(x) 238*x + 596*sqrt(x)

tCost(232) - tCost(137)
## [1] 24712
  1. Find the Taylor polynomial of degree 5 near x = 1 for the following function: \(y = \sqrt{4x - 3}\)
f = function(x) sqrt(4*x - 3)
pracma::taylor(f, 1, 4)
## [1] -10.00254  44.01025 -74.01549  58.01040 -17.00262