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)
(data.frame(x, y))
## x y
## 1 5.6 8.8
## 2 6.3 12.4
## 3 7.0 14.8
## 4 7.7 18.2
## 5 8.4 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 0.0000897 ***
## ---
## 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: 0.00008971
plot(x,y, main = "X vs. Y", xlab = "X", ylab = "Y")
abline(lm_model, col = 'blue', lty = 2)
The linear regression model is:
y = -14.80 + 4.26x
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\]
\[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 =0\] \[6y^2=24\] \[y^2=4\] \[y = \pm 2\]
Take the partial derivative with respect to y: \[\frac{\partial z}{\partial y} = -12xy -24y^2 =0\] \[xy + 2y^2=0\] \[x = -2y\]
If y = -2 :\(x=4\) If y = 2 : \(x=-4\)
\[x = \pm 4\]
Therefore, the critical points to this equation (x,y) 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.
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=0\]
\[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\) where D > 0: max or min; D < 0: saddle point
\(D = 0*(-12x-48y^2)-(-12y)^2 = -144y^2\)
So at critical point (x,y)=(-4,2):
\[D=-144(2)^2 <0 \]
At critical point (x,y)=(4,-2):
\(D=-144(-2)^2 < 0\)
since for both points D < 0, both of our critical points are saddle points of f.
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). Step 2. What is the revenue if she sells the “house” brand for $2.30 and the “name” brand for $4.10?
\[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"
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 = \frac{1}{6}x^2 + \frac{1}{6}(96-x)^2 + 7x + 25(96-x) + 700 = \frac{1}{3}x^2 - 50x + 4636\]
Find the critical points in function C(x):
\[C'(x) = \frac{2}{3}x - 50\] \[x = 75\] \[y = 96-x=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.
C <- function(x){1/3*(x^2) -50*x + 4636}
plot(C(0:96), type='l')
points(75, 2761, pch=19, col="red")
Evaluate the double integral on the given region.
\(\int\int_R (e^{8x+ey}) dA\); \(R:2\leq x\leq4\)
Write your answer in exact form without decimals.
\[\int\int_R (e^{8x + 3y}) dA \]
Above can be rewritten using double integrate as:
\[\int_{y=2}^{y=4} \int_{x=2}^{x=4} (e^{8x+3y}) dA = \int_{y=2}^{y=4} \int_{x=2}^{x=4} (e^{8x+3y}) dx dy \]
where \(dA = {\partial x}{\partial y} = dx dy\)
\[\int_{y=2}^{y=4} \int_{x=2}^{x=4} (e^{8x+3y}) dx dy = \int_2^4 \bigg [ \int_2^4 (e^{8x+3y}) dx \bigg] dy\] \[=\int_2^4 \bigg [ \frac{1}{8}\int_2^4 (e^{8x+3y}) 8dx \bigg] dy\] \[=\int_2^4 \bigg [ \frac{1}{8} (e^{8x+3y}) \bigg |_2^4 \bigg] dy\] \[=\int_2^4 \bigg [ \frac{1}{8} [ (e^{8(4)+3y}) - (e^{8(2)+3y}) ] \bigg] dy\] \[=\int_2^4 \bigg [ \frac{1}{8} [ (e^{32}e^{3y}) - (e^{16}e^{3y}) ] \bigg] dy\] \[=\int_2^4 \bigg [ \frac{1}{8} e^{3y}(e^{32} - e^{16}) \bigg] dy\] \[= \frac{1}{8} (e^{32} - e^{16}) \int_2^4 \frac{1}{3}e^{3y} 3dy\] \[= \frac{1}{8} (e^{32} - e^{16}) \frac{1}{3} \bigg [ e^{3y} \bigg |_2^4 \bigg ]\] \[= \frac{1}{8} (e^{32} - e^{16}) \frac{1}{3} \bigg [ e^{3(4)} - e^{3(2)} \bigg ]\] \[= \frac{1}{24} (e^{32} - e^{16}) (e^{12} - e^6) \] \[= \frac{1}{24} (e^{44} - e^{38} - e^{28} + e^{22}) \]
Solution: \[=\frac{1}{24} \bigg[ e^{44} -e^{38} -e^{28} + e^{22}) \bigg] \]
q5 <- 1/24*(exp(22)-exp(28)-exp(38)+exp(44))
print(paste0("Exact form without decimals: ", format(q5, scientific = F)))
## [1] "Exact form without decimals: 534155947497085056"