Question 1: Regression Line

Find the equation of the regression line for the given points. Round any final values to the nearest hundredth, if necessary.

\[ (5.6, 8.8), \ (6.3, 12.4), \ (7.0, 14.8), \ (7.7, 18.2), \ (8.4, 20.8) \]

The equation for the regression line is \(\ \hat{y} = 4.26x - 14.80\).


# Model the points using lm

x <- c(5.6, 6.3, 7.0, 7.7, 8.4)
y <- c(8.8, 12.4, 14.8, 18.2, 20.8)

model <- lm(y ~ x)

summary(model)
## 
## Call:
## lm(formula = y ~ x)
## 
## 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
ggplot(model, aes(x, y)) + 
  geom_point() + stat_smooth(method="lm") + 
  labs(title="Regression Line: y = 4.26x - 14.80")




Question 2: Max and Min

Find all local maxima, local minima, and saddle points for the function given below. Write your answer(s) in the form \((x, y, z)\). Separate multiple points with a comma.

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

First, calculate partial derivatives:

\[ \begin{align} f_{x} &= 24-6y^2 &f_y &= xy+2y^2 &\text{1st partial derivative} \\ f_{xx} &= 0 &f_{yy} &= -12x-48y^2 &\text{2nd partial derivative} \\ f_{xy} &= 0 &f_{yx} &= -12y &\text{Mixed partial derivative} \end{align} \]


Then, find critical points by setting \(f_x\) and \(f_y\) equal to zero.

\[ \begin{cases} f_x = 24-6y^2=0 \\ f_y = xy+2y^2=0 \end{cases} \]

Solve for \(x\) and \(y\):

\[ \begin{align} 24 - 6y^2 &= 0 &x(2)+2(2)^2 &= 0 &x(-2)+2(-2)^2 &= 0 \\ -6y^2 &= -24 &2x+8&= 0 &-2x-8 &= 0 \\ y^2 &= 4 &2x &= -8 &-2x &= -8 \\ y &= 2, -2 &x &= -4 &x &= 4 \end{align} \]


The critical points are \((-4, 2)\) and \((4, -2)\). Using the second derivative test:

\[ \begin{align} D &= f_{xx}(x_0, y_0) \cdot f_{yy}(x_0, y_0) - f_{xy}(x_0, y_0)^2 \\ &= (0) \cdot (12x-48y^2) - (12y)^2 \\ &= (-12y)^2 \end{align} \]


Solve for \(D\) and \(f_{yy}\) for \((-4,2)\).

\[ \begin{align} &D = (12(2))^2 = 572 &D>0 \\ \\ &f_{yy}(-4,2) = -12(-4)-48(2)^2 = -144 &f_{yy}(x_0, y_0) <0 \end{align} \]


Solve for \(D\) and \(f_{yy}\) for \((4,-2)\).

\[ \begin{align} &D = (12(-2))^2 = 572 &D>0 \\ \\ &f_{yy}(4,-2) = -12(4)-48(-2)^2 = -240 &f_{yy}(x_0, y_0) <0 \end{align} \]


We see that both critical points \((-4,2)\) and \((4,-2)\) are local maxima.




Question 3: Store Revenue

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.

Step 1: Find the revenue function \(R (x, y).\)

\[ \begin{align} \text{Revenue} &= [\text{HB Price} \times \text{HB Units Sold}] + [\text{NB Price} \times \text{NB Units Sold}] \\ \\ &= [x \times (81-21x+17y)] + [y \times (40+11x-23y)]\\ \\ &= 81x - 21x^2 + 17xy + 40y + 11xy - 23y^2 \\ \\ &= -21x^2 - 23y^2 + 81x + 40y + 28xy \end{align} \]


Step 2: What is the revenue if she sells the “house” brand for \(\$2.30\) and the “name” brand for \(\$4.10\)?

The revenue is \(\$116.62\).


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

revenue(2.30, 4.10)
## [1] 116.62



Question 4: Weekly Cost

A company has a plant in Los Angeles and a plant in Denver. The firm is committed to produce a total of \(96\) units of a product each week. The total weekly cost is given by \(C(x,y) = \frac{1}{6}x^2 + \frac{1}{6}y^2 + 7x + 25y + 700\), where \(x\) is the number of units produced in Los Angeles and \(y\) is the number of units produced in Denver. How many units should be produced in each plant to minimize the total weekly cost?

Since \(x + y = 96\), we can substitute \(y = 96-x\) into the cost function to rewrite it in terms of \(x\).

\[ \begin{align} C(x,y) &= \frac{1}{6}x^2 + \frac{1}{6}y^2 + 7x + 25y + 700 \\ \\ C(x) &= \frac{x^2}{6} + \frac{(96-x)^2}{6} + 25(96-x) + 700 \\ \\ &= \frac{x^2}{6} + \frac{x^2}{6} + \frac{9216}{6} - \frac{192x}{6} + 7x + 2400 - 25x + 700 \\ \\ &= \frac{1}{3}x^2 + 1536 - 32x - 18x + 3100 \\ \\ &= \frac{1}{3}x^2 - 50x + 4636 \end{align} \]


Find the critical value of \(C(x)\) by taking its derivative and setting it equal to zero:

\[ \begin{align} C'(x) &= \frac{2}{3}x-50 \\ \\ 0 &= \frac{2}{3}x-50 \\ \\ x &= 75 \text{ units from Los Angeles} \end{align} \]


Finally, plug \(x\) into the initial function to get \(y\):

\[ \begin{align} y &= 96-75 \\ y &= 21 \text{ units from Denver} \end{align} \]


To minimize weekly costs, the company should produce 75 units from Los Angeles and 21 units from Denver.




Question 5: Double Integral

Evaluate the double integral on the given region. Write your answer in exact form without decimals.

\[ \displaystyle \iint_R (e^{8x+3y}) \ dA; \qquad R: \ 2 \leq x \leq 4 \qquad and \qquad 2 \leq y \leq 4 \]


Rewrite as:

\[ \int_2^4 \int_2^4 (e^{8x+3y}) \ dx \ dy \]


Evaluate the inner integral using \(u\)-substitution. Set \(u = 8x+3y\). That means:

\[ \begin{align} du = 8 \ dx \\ dx = \frac{1}{8} du \end{align} \]

Substitute \(u\) and \(dx\) back into the function and evaluate:

\[ \begin{align} \int_2^4 (e^u) \cdot \frac{1}{8}du = \frac{1}{8} \int e^u \ du &= \frac{1}{8} \left. \int e^{8x+3y} \ du \right|_2^4 \\ \\ &= \frac{1}{8}(e^{32+3y} - e^{16+3y}) \end{align} \]

Integrate again on \(dy\):

\[ \begin{align} &\int_2^4 \frac{1}{8}(e^{32+3y} - e^{16+3y}) \ dy \\ \\ &= \int_2^4 \frac{1}{8} \cdot \frac{1}{3} \cdot (e^{32+3y} - e^{16+3y}) \ dy \\ \\ &= \left. \frac{1}{8} \cdot \frac{1}{3} \cdot (e^{32+3y}) \right|_2^4 - \left. \frac{1}{8} \cdot \frac{1}{3} (e^{16+3y}) \right|_2^4 \\ &= \frac{1}{24} [e^{32+12} - e^{32+6}] - \frac{1}{24}[e^{16+12} - e^{16+6}]\\ \\ &= \frac{1}{24} \ (e^{44} - e^{38} - e^{28} + e^{22}) \end{align} \]