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_vals <- c(5.6,6.3,7,7.7,8.4)
y_vals <- c(8.8,12.4,14.8,18.2,20.8)
# calculate the mean of x values
xbar <- sum(x_vals)/length(x_vals)
# calculate the mean of y values
ybar <- sum(y_vals)/length(y_vals)
# function to calculate slope
calculate_slope <- function(x_vals, y_vals) {
numerator <- sum((x_vals - xbar) * (y_vals - ybar))
denominator <- sum((x_vals - xbar) ^ 2)
slope <- numerator / denominator
return(slope)
}
slope <-calculate_slope(x_vals,y_vals)
# calculate y-intercept (b)
calculate_y_int <- function(xbar, ybar, slope){
b = ybar - (slope * xbar)
return(b)
}
b <- calculate_y_int(xbar,ybar,slope)
print(paste0("The slope is: ", round(slope,2)))
## [1] "The slope is: 4.26"
print(paste0("The y-intercept is: ", b))
## [1] "The y-intercept is: -14.8"
The equation of the regression line is \(\bar{y} = 4.26 \bar{x} - 14.8\).
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\)
\[ \text{First find the partial derivatives with respect to x and y:}\\ \frac{\partial f}{\partial x} = 24 - 6y^2 \text{ & } \frac{\partial f}{\partial y} = -12xy - 24y^2\\ \text{Set the partial derivatives to 0 to find the critical points: }\\ \frac{\partial f}{\partial x} =24-6y^2 = 0 \rightarrow y = \pm 2\\ \frac{\partial f}{\partial y} = -12xy - 24y^2 = 0 \\ \text{When } y=2:\\ -24x-96 = 0 \rightarrow -24x=96 \rightarrow x=-4\\ \text{When } y=-2:\\ 24x-96=0 \rightarrow x=4\\ \text{The critical points are } (-4,2) \text{ & } (4,-2).\\ \text{Now we'll compute the second partial derivatives: }\\ \frac{\partial^2 f}{\partial^2 x} =0 \text{ & } \frac{\partial^2 f}{\partial^2 y} = -12x-48y \text{ & } \frac{\partial^2}{\partial x \partial y} = -12y\\ \text{Solve at } (-4,2) \text{ to determine its nature:}\\ \frac{\partial^2 f}{\partial^2x} = 0\\ \frac{\partial^2 f}{\partial^2 y} = 48-96=-48 < 0 \text{ Concave Down}\\ \frac{\partial^2 f}{\partial x\partial y } = -24 <0\\ (-4,2) \text{ is a local maxima}\\ \text{Solve at } (4,-2) \text{ to determine its nature:}\\ \frac{\partial^2 f}{\partial^2x}= 0\\ \frac{\partial^2 f}{\partial^2 y} = -48 + 96 = 48 >0 \text{ Concave up} \\ \frac{\partial^2 f}{\partial x\partial y } = 48 >0\\ (4,-2) \text{ is a local minima}\\ \text{Solve for Z:}\\ \text{At } (4,-2):\\ 24(4) - 6(4)(-2)^2 - 8(-2)^3 = 96-96+64 = 64\\ \text{At } (-4,2):\\ 24(-4)-6(-4)(4)-8(2)^3 = -64\\ \text{To determine if the points are saddle points: } D(x,y) = f_{xx}f_{yy} - f_{xy}^2\\ = 0 \cdot (-12x -48y) - (-12y)^2 = -144y^2\\ \text{At } (-4,2,-64): -576 <0\\ \text{At } (4,-2,64): -576 <0\\ \text{In conclusion, } (4,-2,64) \text{ is a local minima, } (-4,2,-64) \text{ is a local maxima, and both } (4,-2,64) \text{ & } (-4,2,-64) \text{ are saddle points.} \]
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 ).
The revenue function for selling the “house” brand is: \(R_H = x \cdot (81 - 2x + 17y)\)
The revenue function for selling the “name” brand is: \(R_N = y \cdot (40 + 11x - 23y)\)
So, the total revenue function is: \[ R(x,y) = R_H + R_N = x(81-21x+17y) + y(40+11x-23y)\\ = 81x -21x^2 +17xy +40y +11xy -23y^2\\ = 81x -21x^2 +28xy + 40y -23y^2 \]
Step 2. What is the revenue if she sells the “house” brand for $2.30 and the “name” brand for $4.10?
revenue <- function(x,y){
r <- 81*x - 21*x^2 + 28*x*y + 40*y - 23*y^2
return(r)
}
revenue(2.3,4.1)
## [1] 116.62
The revenue is $116.62.
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?
\[ C(x, y) = \frac{1}{6} x^2 + \frac{1}{6} y^2 + 7x + 25y + 700\\ \text{Find the critical points: }\\ \frac{\partial C}{\partial x} = \frac{1}{3} + 7\\ \frac{\partial C}{\partial y} = \frac{1}{3} + 25\\ \text{Set both equal to 0:}\\ \frac{\partial C}{\partial x} = \frac{1}{3} + 7 = 0 \rightarrow x = -21\\ \frac{\partial C}{\partial y} = \frac{1}{3} + 25 = 0 \rightarrow y = -75\\ \text{Find the second partial derivatives to determine the nature of the critical point:}\\ C_{xx} = \frac{1}{3} >0 \text{ Concave Up} \\ C_{yy} = \frac{1}{3} >0 \text{ Concave Up} \\ (-21, -75) \text{ is a local minima} \] To minimize the total weekly cost, Los Angeles should produce 21 units and Denver should produce 75 units.
Evaluate the double integral on the given region.
\[ \int \int_{R} (e^{8x+3y})dA; R:2 \leq x \leq 4 \text{ and } 2 \leq y \leq 4 \] Write your answer in exact form without decimals.
\[ \int \int_R e^{8x+3y} dA = \int_y \int_x e^{8x+3y} dx dy\\ = \int_2^4 \int_2^4 e^{8x+3y} dx dy = \int_2^4 \frac{e^{8x+3y}}{8} dy \\ =\int_2^4 [\frac{e^{8x+3y}}{8}]_2^4 dy =\int_2^4 \frac{e^{32+3y}}{8} - \frac{e^{16+3y}}{8} dy\\ = \frac{e^{32+3y}}{24} - \frac{e^{16+3y}}{24} |_2^4\\ =[\frac{e^{32+12}}{24} -\frac{e^{16+12}}{24}] - [\frac{e^{32+6}}{24}-\frac{e^{16+6}}{24}]\\ = \frac{e^{44}}{24}-\frac{e^{28}}{24}-\frac{e^{38}}{24}+\frac{e^{22}}{24}\\ =\frac{1}{24}(e^{44}-e^{28}-e^{38}+e^{22}) \]
(exp(44) - exp(28) - exp(38) + exp(22))/24
## [1] 5.341559e+17
5.341559e+17 = 534,155,900,000,000,000