x <- c(5.6, 6.3, 7, 7.7, 8.4)
y <- c(8.8, 12.4, 14.8, 18.2, 20.8)
b0 <- round(summary(lm(y ~ x))$coefficients[1], 2)
b1 <- round(summary(lm(y ~ x))$coefficients[2], 2)
The equation of the regression line is y=−14.8+4.26x
1st order partial derivatives with respect to x: fx(x,y)=24−6y2=0 y=(2,−2) 1st order partial derivatives with respect to y: fy(x,y)=−12xy−24y2 wheny=2,x=−4 wheny=−2,x=4 Therefore, the critical points of this equation are (−4,2) and (4,−2)
2nd order partial derivatives with respect to x: fxx(x,y)=0 2nd order partial derivatives with respect to y: fyy(x,y)=−12x−48y
∴
Second Derivative Test: D=f_{xx}(x,y)f_{yy}(x,y)-f_{xy}(x,y)^2
Critical point (4, -2): D=0*-12x-48y-(-12y)^2 D=0*-12(4)-48(-2)-(-12(-2))^2=-576
Critical point (-4, 2): D=0*-12x-48y-(-12y)^2 D=0*-12(-4)-48(2)-(-12(2))^2=-576
Since D<0, critical points (−4,2) and (4,−2) are saddle points.
\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)
}
print(paste0("The revenue if she sells the 'house' brand for $2.30 and the 'name' brand for $4.10 is $", revenue(2.3, 4.1)))
## [1] "The revenue if she sells the 'house' brand for $2.30 and the 'name' brand for $4.10 is $116.62"
Let us find units produced in Los Angeles by finding the first derivative of the equation with respect to x, \text{Given, } \enspace x+y=96 \therefore y=96-x \text{Substitute y in to the equation, } \enspace C(x,y)=\frac{x^2}{6}+\frac{(96-x)^2}{6}+7x+25(96-x)+700 \therefore C(x)=\frac{x^2}{3}-50x+4636 1st order derivative to get the critical points: C'(x)=\frac{2x}{3}-50=0 \text{Solving for x, }x=75 Let us now find units produced in Denver, 75+y=96 y=21 Therefore, 75 units should be produced in Los Angeles and 21 units should be produced in Denver to minimize the total weekly cost.
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"