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 )

library(knitr)

x1 <- c(5.6, 6.3, 7, 7.7, 8.4)
y1 <- c(8.8, 12.4, 14.8, 18.2, 20.8)

lm_m1 <- lm(x1 ~ y1)
print(lm_m1)
## 
## Call:
## lm(formula = x1 ~ y1)
## 
## Coefficients:
## (Intercept)           y1  
##      3.4890       0.2341
lm_m2 <- lm(y1 ~ x1)
print(lm_m2)
## 
## Call:
## lm(formula = y1 ~ x1)
## 
## Coefficients:
## (Intercept)           x1  
##     -14.800        4.257
dset = matrix(c(5.6,8.8,6.3,12.4,7,14.8,7.7,18.2,8.4,20.8),ncol=2,byrow=TRUE)
colnames(dset) = c("X","Y")
dset = data.frame(dset)
dset$XY<- dset$X *dset$Y
dset$XY<- dset$X *dset$Y
dset$Xsq<- dset$X^2
dset$Ysq<- dset$Y^2

kable(dset)
X Y XY Xsq Ysq
5.6 8.8 49.28 31.36 77.44
6.3 12.4 78.12 39.69 153.76
7.0 14.8 103.60 49.00 219.04
7.7 18.2 140.14 59.29 331.24
8.4 20.8 174.72 70.56 432.64
#summary of columns
dsum <- (colSums(dset[,]))
dsum
##       X       Y      XY     Xsq     Ysq 
##   35.00   75.00  545.86  249.90 1214.12
x  <-dsum[1]
y  <-dsum[2]
xy <-dsum[3]
xsq<-dsum[4]
ysq<-dsum[5]
#(sum(y) * sum(x^2)) - ((sum(x) * sum(xy)) / 5(sum(x^2)- sum(x)^2)
a1=( (y * xsq ) - (x * xy) )/ (5* (xsq - x^2))

#(5(sum(xy) -(sum(x) * sum(y)))/(5(sum(x^2) - sum(x)^2)

b1 = ( (5*xy - (x*y) )/(5*(xsq - x^2)) )

a1
##          Y 
## 0.07437186
b1
##          XY 
## -0.02139268
#y = a + b*x

\[Y = 0.07 - 0.02 * X\]

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.

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

compute the values of \[ \frac {df}{dx} and \frac{df}{dy} \]

\[ \frac {df}{dx} = \frac {d}{dx} (24x -6xy^2 -8y^3)\]

\[ = 24 -6y^2 \]

\[ \frac {df}{dy} = \frac {d}{dy} (24x -6xy^2 -8y^3) \]

\[ = -12xy -24y^2\]

To find the critical points, equate \[ \frac {df}{dx} and \frac{df}{dy} \] to zeros:

\[ 24 - 6y^2 = 0 \]

\[ 24 = 6y^2 \]

\[ 4 = y^2 \]

\[ y = 2, -2 \]

\[ -12xy -24y^2 = 0 \]

\[ -12xy = 24y^2 \]

\[ -xy = 2y^2 \]

\[ -x = 2y \]

so the critical points are \[ (-4,2) and (4,-2) \]

According to the second derivative test, the value of the discriminant is

\[ D=f_{xx}f_{yy} - f``_{xy} \]

And the second derivate test asserts the following:

  1. If D(a,b) > 0 and f_{xx}(a,b) >0 then (a,b) is a local minimum of f.

  2. If D(a,b) > 0 and f_{xx}(a,b) <0 then (a,b) is a local maximum of f.

  3. If D(a,b) < 0 then (a,b) is a saddle point of f.

  4. If D(a,b) > 0 then this test is inconclusive.

So, calculate the partial derivatives as below:

\[ f_{xx} = \frac {d}{dx}(f_x) = \frac {d}{dx}(24 -6y^2) = 0 \]

\[ f_{yy} = \frac {d}{dy}(f_y) = \frac {d}{dy}(-12xy -24y^2) = -12x -48y \]

\[ f_{xy} = \frac {d}{dx}(f_y) = \frac {d}{dx}(-12xy -24y^2) = -12y \]

so, the value of the discriminant is

D=(0)(-12x-48Y) -(-12Y)^2

\[D =-144Y^2\] At the critical point \[ (-4,2) and (4,-2) \] The discriminant is

\[ D = -144*4 = -576 \] Since D < 0 the critical point is saddle point of f..

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.

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

Total revenue is given by

R = Revenue from brand X + Revenue from brand Y

\[ R = x(81- 21x +17y) + y(40 + 11x - 23y) \]

\[=81x - 21x^2 + 17xy + 40y + 11xy -23y^2\]

\[ = -21x^2 -23y^2 + 28xy + 81x +40y \] now find out partial derivatives

\[\frac {dR}{dx} = -42x + 28y + 81 \]

\[\frac {dR}{dy} = -46y + 28x + 40 \]

So critical points are roots of following equations

-42x + 28y + 81 = 0

28x - 46y + 40 = 0

y= -2.4, x = 0.32

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

Rev2= -21*(2.30)^2 -23*(4.10)^2 + 28*(2.3)*(4.1) + 81*(2.3) + 40*(4.1) 

Rev2
## [1] 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?

\[ x + y =96 \] \[ C(x, y) = \frac{1}{6}x^2 + \frac{1}{6}y^2 + 7x + 25y + 700 \] \[ C`(X) = \frac{1}{3}x + 7 \] \[ 0 = \frac{1}{3}x + 7 \]

\[ -7 = \frac{1}{3}x \] \[ -21 = x \] \[ C`(Y) = \frac{1}{3}y + 25 \]

\[ 0 = \frac{1}{3}y + 25 \] \[ - 25 = \frac{1}{3}y \]

\[ -75 = y \] (x,y) = (75,21) are the units to be produced in each of the units.

5. Evaluate the double integral on the given region.

\[\int\int(e^{8x + 3y})DA: R:2<x<=4 and 2<y<=4 \]

\[\int_{2}^{4}\int_{2}^{4}(e^{8x + 3y})DA \]

\[\int_{2}^{4}\int_{2}^{4}(e^{8x + 3y}) \frac {3dy}{3}.dx \]

\[=\frac{1}{3}\int_{2}^{4}\bigg[(e^{8x + 3y})\bigg]_{2}^{4}. dx\]

\[=\frac{1}{3}\int_{2}^{4} (e^{8x+12} -e^{8x +6} )dx \]

\[=\frac{1}{3}\int_{2}^{4} (e^{8x+12} -e^{8x +6} ). \frac{8}{8}dx \]

\[=\frac{1}{24} \bigg[ (e^{8x+12} -e^{8x +6} ) \bigg] _{2}^{4}\]

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

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

\[=\frac{1}{24} . 1 \]