Question 1

Find the equation for the regression line for the points given in points.

points <- data.frame('x' = c(5.6,6.3,7,7.7,8.4), 'y' = c(8.8,12.4,14.8,18.2,20.8))

reg <- lm(y ~ x, data = points)
summary(reg)
## 
## Call:
## lm(formula = y ~ x, data = points)
## 
## Residuals:
##     1     2     3     4     5 
## -0.24  0.38 -0.20  0.22 -0.16 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -14.8000     1.0365  -14.28 0.000744 ***
## x             4.2571     0.1466   29.04 8.97e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3246 on 3 degrees of freedom
## Multiple R-squared:  0.9965, Adjusted R-squared:  0.9953 
## F-statistic: 843.1 on 1 and 3 DF,  p-value: 8.971e-05
regplot <- ggplot(points, aes(x = x, y = y, na.rm = TRUE))+
  geom_point(na.rm = TRUE, color = 'darkseagreen', size = 5)+
  geom_smooth(method = "lm", color = 'red', se = FALSE)+
  ggtitle("Regression Line for Coordinate Pairs")+
  xlab('x')+
  ylab('y')+
  theme(plot.title = element_text(hjust = 0.5, size = 7.5))
regplot
## `geom_smooth()` using formula 'y ~ x'

Question 2

Extrema for \(f(x,y) = 24x -6xy^2 - 8y^3\)

\(f_{x} = 24 - 6y^2\), \(f_{xx} = 0\), \(f_{xy} = -12y\)

\(f_{y} = -12xy - 24y^2\), \(f_{yy} = -12x - 48y\), \(f_{yx} = -12y\)

Critical Values: Set \(f_{x}, f_y = 0\)

\(24 - 6y^2 = 0 = -12xy - 24y^2\)

\(y = \pm {2}\)

\(-12({2})x - 24(4) = 0\), \(-12(-{2})x - 24(4) = 0\)

\(x = -4\), \(x = 4\)

Critical Values: \((-4, {2}), (4, -{2})\)

Open Disk Calculation:

\(D = f_{xx}f_{yy} - {f_{xy}}^2\)

\(D = 0 *(12x -48y) - (-12y)^2\), evaluated at \((-4, {2})\):

\(D = -12*({2})^2\)

\(D = -48\)

Similarly for \((4, -{2})\):

\(D = -48\), because the sign change in y is irrelevant because it is squared.

From Theorem 12.8.2, the Second Derivative Test, Because D is negative, \(f\) has a saddle point at each point where D is negative.

Saddle Point at \((-4, {2})\)

Saddle Point at \((4, -{2})\)

Question 3

X: House Brand Price Y: Name Brand Price

\(81 - 21x + 17y\) \(40 + 11x -23y\)

A grocery store sells two brands of a product, the “house” brand and a “name” brand. The manager estimates that if she sells the “house” brand for x dollars and the “name” brand for y dollars, she will be able to sell 81 -21x + 17y units of the “house” brand and 40 + 11x - 23y units of the “name” brand.

This question does not necessarily make sense.

x and y are in dollars. Are the units of the coefficients \(\frac 1{dollars}\)?

Step 1:

\(R(x,y)\)

The revenue would be given by the number of each unit sold, multiplied by the cost for each unit, respectively.

So, \(R(x,y) = (81 - 21x + 17y)*x + (40 + 11x -23y)*y\)

\(R(x,y) = 81x - 21x^2 + 17xy + 40y + 11xy -23y^2\)

\(R(x,y) = 81x - 21x^2 + 28xy + 40y -23y^2\)

Step 2:

If she sells the house brand for $2.30 and the name brand for $4.10, the revenue would be as follows:

\(R(2.30,4.10) = 81(2.30) - 21(2.30)^2 + 28(2.30)(4.10) + 40(4.10) -23(4.10)^2\)

revenue <- function(x,y){
  out = 81*x - 21*(x^2) + 28*x*y + 40*y -23*(y^2)
  return(out)
}

revenue(2.3,4.1)
## [1] 116.62

So, the revenue would be $116.62

Question 4:

\(C(x,y) = \frac 16 x^2 + \frac 16 y^2 + 7x + 25y + 700\) x: Number Produced in LA y: Number Produced in Denver

96 total products to be sold. At the end, I will substitute 96 - x for x and 96 - y for y.

Minimize total weekly cost. Find Extrema

\(f_{x} = \frac 13 x + 7\), \(f_{xx} = \frac 13\), \(f_{xy} = 0\)

\(f_{y} = \frac 13 y + 25\), \(f_{yy} = \frac 13\), \(f_{yx} = 0\)

Critical Values: Set \(f_{x}, f_y = 0\)

\(\frac 13 x + 7 = 0 = \frac 13 y + 25\)

\(x = -21\)

\(y = -75\)

Critical Value: \((-21,-75)\)

Second Derivative test to confirm if the critical value is a relative minimum:

\(D = f_{xx}f_{yy} - {f_{xy}}^2\)

D must be greater than 0 and \(f_{xx}(x_0,y_0)\) must be greater than 0.

\(D = \frac13*\frac13 - 0^2\) \(D = \frac 19\)

\(f_{xx}(-21.-75) = \frac 13 > 0\)

So, the critical value is in fact a relative minimum.

\(C(-21,-75) = \frac 16 (-21)^2 + \frac 16 (-75)^2 + 7(-21) + 25(-75) + 700\)

cost <- function(x,y){
  out <- (1/6)*x^2 + (1/6)*y^2 + 7*x + 25*y + 700
  return(out)
}

cost(-21,-75)
## [1] -311

So, the cost is $311. This means that it costs $311 to make 75 units in LA and 21 units in Denver

Question 5:

\(\int \int{e^{8x + 3y}dA}\), where R: \(2\leq x \leq 4\) and \(2 \leq y \leq 4\)

\(\int \int{e^{8x + 3y}dA} = \int_{2}^{4} \int_{2}^{4}{e^{8x + 3y}dxdy}\)

\(\int_{2}^{4} [\frac 18 {e^{8x + 3y}]|_2^4 dy} = \int_{2}^{4} \frac 18 ({e^{32 + 3y} - {e^{16 + 3y}})dy}\)

\(\int_{2}^{4} \frac 18 ({e^{32 + 3y} - {e^{16 + 3y}})dy} = [\frac 18*\frac 13 ({e^{32 + 3y} - {e^{16 + 3y}}})]|_2^4\)

\(= \frac 1{24}[({e^{32 + 12} - {e^{16 + 12}}}) - ({e^{32 + 6} - {e^{16 + 6}}})]\)

\(= \frac 1{24}[({e^{44} - {e^{28}}}) - ({e^{38} - {e^{22}}})]\)

Answer

\(\int \int{e^{8x + 3y}dA} = \frac 1{24}[{e^{44} - {e^{28}}} - {e^{38} + {e^{22}}}]\)