Q1

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

model <- lm(y ~ x)

summary(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

The equation of the regression line is \(y= 4.26x - 14.8\)


Q2

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

Step 1: Find partial derivatives.

\(\frac {\partial f}{\partial x} = 24 - 6y^2\)

\(\frac {\partial^2 f}{\partial x^2} = 0\)

\(\frac {\partial f}{\partial y} = -12xy - 24y^2\)

\(\frac {\partial^2 f}{\partial y^2} = -12x - 48y\)

\(\frac {\partial f}{\partial xy} = -12y\)

Step 2: Find the critical points.

\[\begin{align*} \frac {\partial f}{\partial y} &= 0 \\ xy + 2y^2 &= 0 \\ x(2) + 2(2)^2 &= 0 \\ 2x + 8 &= 0 \\ x &= -4 \end{align*}\]

\[\begin{align*} \frac {\partial f}{\partial x} &= 0 \\ 24 - 6y^2 &= 0 \\ 6y^2 &= 24 \\ y^2 &= 4 \\ y &= \pm 2 \end{align*}\]

Therefore, the critical points are \((4,-2)\) and \((-4,2)\).

Step 3: Classify the critical points.

\(D(x,y) = \frac {\partial^2 f}{\partial x^2} \cdot \frac {\partial^2 f}{\partial y^2} - [\frac {\partial f}{\partial xy}]^2\)

\(D(x,y) = 0 \cdot (-12x - 48y) - (-12y)^2 = -144y^2\)

\(D(-4,2) = -144(2)^2 = -576\)

\(D(-4,2) = -144(-2)^2 = -576\)

\(D\) is negative for both critical points. Both are saddle points. There are no relative minima or maxima.


Q3

\[\begin{align*} Revenue &= \# {units \space sold} * unit \space price \\ R(x,y) &= x(81 - 21x + 17y) + y(40 + 11x - 23y) \\ &= 81x - 21x^2 + 17xy + 40y + 11xy -23y^2 \\ &= -21x^2 + 28xy + 81x + 40y - 23y^2 \end{align*}\]

Find R(2.3, 4.1).

x <- 2.3
y <- 4.1

R <- function(x,y) {
  return (-21*x^2 + 28*x*y + 81*x + 40*y - 23*y^2)
}

print(R(x,y))
## [1] 116.62

The revenue is $116.62.


Q4

\(C(x,y) = \frac{1}{6}x^2 + {1}{6}y^2 + 7x + 25y + 700\)

Also, there is the constraint \(x+y =96\).

\(y = 96-x\). Plug into \(C(x,y)\) so that we only have to deal with one variable.

\(C(x) = \frac{1}{6}x^2 + \frac{1}{6}(96-x)^2 + 7x + 25(96-x) + 700\)

\(C(x) = \frac{x^3}{3} - 50x + \frac{96^2}{6} + 25 \cdot 96 + 700\)

\(C'(x) = \frac{2x}{3} - 50\)

\(C''(x) = \frac{2}{3}\). The cost function is concave up with the minimum at \(x\) when \(C'(x) = 0\).

Find the critical point.

\[\begin{align*} \frac{2}{3}x - 50 &= 0 \\ \frac{2}{3}x &= 50 \\ x &= 75 \end{align*}\]

Since \(x+y=96\), \(y=96-75 = 21\). The minimum occurs at \(x=75\). 75 units should be produced in Los Angeles and 21 units should be produced in Denver.


Q5

\(\int \int_{R} (e^{8x+3y}) \;dA ; R: 2 \le x \le 4\) and \(2 \le y \le 4\)

Start with the inner integral and integrate with respect to \(x\).

Let \(u = 8x + 3y\)

\(\frac{du}{dx} = 8\)

\(dx = \frac{1}{8} du\)

Write the restraints of x in terms of u.

For \(x=4\), \(u = 8(4) + 3y = 32+3y\).

For \(x=2\), \(u = 8(2) + 3y = 16 + 3y\).

Plug these into the inner integral, \(\int_{2}^{4} e^{8x+3y} \; dx\):

\(\frac{1}{8} \int_{16+3y}^{32+3y} e^u \; du\)

\(\frac{1}{8} [e^{32+3y} - e^{16+3y}]\)

Now integrate this with respect to \(y\). Start by writing the restraints of \(y\) in terms of \(u\).

Let \(u=3y\)

\(\frac{du}{dy} = 3\)

\(dy = \frac{1}{3} du\)

\(u = 3(4) = 12\)

\(u = 3(2) = 6\)

Plug these into the integral \(\frac{1}{8} \int_{2}^{4} {e^{32+3y} - e^{16+3y}} \; dy\).

\(\frac{1}{8} (e^{32} \cdot \frac{1}{3} \int_{6}^{12} e^u \; du - e^{16} \cdot \frac{1}{3} \int_{6}^{12} e^u \; du )\)

\(\frac{1}{8} (\frac{e^{32}}{3}[e^{12} - e^{6}] - \frac{e^{16}}{3}[e^{12}-e^{6}])\)

\(\frac{1}{8} ([\frac{e^{44} - e^{38}}{3} - \frac{e^{28} - e^{22}}{3}])\)

\(\frac{1}{8} (\frac{e^{44}-e^{38}-e^{28}+e^{22}}{3})\)

\(\frac{1}{24} (e^{44} - e^{38} - e^{28} + e^{22})\)