1. 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,14.8), (7.7,18.2),(8.4,20.8)\]
x <- c(5.6, 6.3, 7, 7.7, 8.4)
y <- c(8.8, 12.4, 14.8, 18.2, 20.8)
lm_model <- lm(y ~ x)
print(lm_model)
##
## Call:
## lm(formula = y ~ x)
##
## Coefficients:
## (Intercept) x
## -14.800 4.257
print(summary(lm_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
plot(x,y, main = "X vs. Y", xlab = "X", ylab = "Y")
abline(lm_model, col = 'blue', lty = 2)
The linear regression model is:
\[\text{Linear Regression } y = -14.80 + 4.26x\]
2. 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.
Reference: http://tutorial.math.lamar.edu/Classes/CalcIII/RelativeExtrema.aspx
\[f(x,y) = z = 24x - 6xy^2 - 8y^3\]
Take the partial derivative with respect to x:
\[\frac{\partial z}{\partial x} = 24 - 6y^2\]
Take the partial derivative with respect to y:
\[\frac{\partial z}{\partial y} = -12xy - 24y^2\]
We now must find the critical points, which is when \(\nabla z = \vec{0}\).
Regarding in respect to x:
\[\frac{\partial z}{\partial x} = 24 - 6y^2 = 0\] \[4 - y^2 = 0\] \[ y^2 = 4\] \[ y = -2 \text{ and } 2\]
Regarding in respect to y:
\[\frac{\partial z}{\partial y} = -12xy - 24y^2 = 0\] \[xy + 2y^2 = 0\] Plug in \(y = -2\):
\[x(-2) + 2(-2)^2 = 0\] \[-2x + 8 = 0\] \[x = 4\]
Plug in \(y = 2\):
\[x(2) + 2(2)^2 = 0\] \[2x + 8 = 0\]
\[x = -4\] Therefore, the critical points to this equation is: \((-4, 2)\) and \((4, -2)\).
To find whether or not if the critical points are minima, maxima or saddles, we need to take the partial second derivative for each critical point to find the concavity. If the concavity is positive, the critical point is a minima; if the concavity is a negative, the critical point is a positive. (There is more to this as we get farther into this question.)
In respect to x:
\[\frac{\partial^2 z}{\partial x^2} = 0\]
In respect to y:
\[\frac{\partial^2 z}{\partial y^2} = -12x - 48y^2\]
Now let’s find \(f_{xy}\):
\[f_{xy} = -12y\]
In order to find whether or not these points are maxima, minima, or saddle points, we will need to use the equation below:
\[D = f_{xx}(x,y) f_{yy}(x,y) - f_{xy}(x,y)^2 \text{ where D > 0: max or min; D < 0: saddle point}\]
\[D = 0 * (-12x - 48y^2) - (-12y)^2 = 12y^2\] So at critical point \((x,y) = (-4,2)\):
\[D = 12(2)^2 > 0 \text{ and } \frac{\partial^2 z}{\partial y^2}(-4,2) = -12(-4) - 48(2)^2 = -144\] So \((-4,2)\) has a negative concavity and \(D > 0\), this point is a maxima.
At critical point \((x,y) = (4,-2)\):
\[D = 12(-2)^2 > 0 \text{ and } \frac{\partial^2 z}{\partial y^2}(4,-2) = -12(4) - 48(-2)^2 = -240\] \((4,-2)\) has a negative concavity and \(H >0\), therefore, this point is also another maxima.
3. 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.
\[\text{Revenue = (Units Sold) x (Sales Price)}\]
\[R(x,y) = x * (81 - 21x + 17y) + y * (40 + 11x - 23y)\] \[R(x,y) = 81x - 21x^2 + 17xy + 40y +11xy - 23y^2\] \[R(x,y) = -21x^2 - 23y^2 + 81x + 40y + 28xy\]
revenue <- function(x,y){
return(-21*(x^2) - 23*(y^2) + 81*x + 40*y + 28*x*y)
}
rev_return <- revenue(2.30, 4.10)
print(paste0("Revenue: $", round(rev_return, 2)))
## [1] "Revenue: $116.62"
4. 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?
Total number of units produced is 96, x from Los Angeles and y from Denver.
\[x + y = 96\]
\[y = 96 - x\] Substitute y into the formula \(C(x,y)\).
\[C(x,y) = \frac{1}{6} x^2 + \frac{1}{6} y^2 + 7x + 25y + 700\] \[C(x,y) = \frac{1}{6} x^2 + \frac{1}{6} (96 - x)^2 + 7x + 25(96-x) + 700\] \[C(x) = \frac{1}{6} x^2 + \frac{9216 -192x + x^2}{6} + 7x + 2400 - 25x + 700\] \[C(x) = \frac{1}{6} x^2 + 1536 - 32x + \frac{x^2}{6} + 7x + 2400 - 25x + 700\] \[C(x) = \frac{1}{3} x^2 - 50x + 4636\] Find the critical points in function \(C(x)\):
\[C'(x) = \frac{2}{3} x - 50\] \[\frac{2}{3} x - 50 = 0\] \[x = 75\] Therefore, if we plug in for x:
\[75 + y = 96\] \[y = 21\]
Given that there are only one set of critical points, \(x = 75\) and \(y = 21\), these are the optimal production amounts. Therefore, 75 units should be produced in Los Angeles, and 21 units should be produced in Denver to minimize the costs.
5. Evaluate the double integral on the given region.
\[\int \int_R (e^{8x + ey}) dA; R: 2 \leq x \leq 4 \text{ and } 2 \leq y \leq 4\] Write your answer in exact form without decimals
We can rewrite this double integrate as:
\[\int_{y = 2}^{y = 4} \int_{x = 2}^{x = 4} (e^{8x + ey}) \text{ }dx \text{ }dy = \int_{y = 2}^{y = 4} \int_{x = 2}^{x = 4} (e^{8x}e^{ey}) \text{ }dx \text{ }dy\] Note: \(dA = dx \text{ } dy\)
We will perform this integration with U substitution.
\[\text{Let u } = 8x\] \[\frac{du}{dx} = 8 \text{ which translates to } du = 8 \text{ }dx\] \[\int_{y = 2}^{y = 4} \int_{u = 16}^{u = 32} e^{ey}e^u * \frac{1}{8} du \text{ } dy = \int_{y = 2}^{y = 4} \frac{e^{ey}}{8} \int_{u = 16}^{u = 32} e^u du \text{ }dy\] Let’s integrate with respect to u first:
\[\int_{u = 16}^{u = 32} e^u du = e^u|_{16}^{32} = e^{32} - e^{16}\]
Now let’s integrate with respect to y via u substitution:
\[\int_{y=2}^{y=4} \frac{e^{32} - e^{16}}{8} e^{ey} \text{ }dy = \frac{e^{32} - e^{16}}{8} \int_{y=2}^{y=4} e^{ey} \text{ } dy\]
Let \(u = ey\). Therefore, \(\frac{du}{dy} = e\), or in other words, \(du = e \text{ } dy\)
\[\frac{e^{32} - e^{16}}{8} \int_{u=2e}^{u=4e} \frac{1}{e}e^{u} \text{ } du = \frac{e^{32} - e^{16}}{8e} \int_{u=2e}^{u=4e} e^{u} \text{ } du\]
\[= (\frac{e^{31} - e^{15}}{8}) e^u|_{2e}^{4e} = (\frac{e^{31} - e^{15}}{8}) (e^{4e}-e^{2e}) + c\]
Solution: \((\frac{e^{31} - e^{15}}{8}) (e^{4e}-e^{2e}) + c\)