library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.3 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
\[ ( 5.6, 8.8 ), ( 6.3, 12.4 ), ( 7, 14.8 ), ( 7.7, 18.2 ), ( 8.4, 20.8 ) \]
\[\begin{align*} Y &= mX + b \\ m &= \frac{n\sum(xy) - \sum(x)\sum(y)}{n\sum(x^2) - (\sum x)^2} \\ b &= \frac{\sum(y)\sum(x^2) - \sum(x)\sum(xy)}{n\sum(x^2) - \sum(x)^2} \end{align*}\]
x <- c(5.6, 6.3, 7, 7.7, 8.4)
y <- c(8.8, 12.4, 14.8, 18.2, 20.8)
lm(y ~ x)
##
## Call:
## lm(formula = y ~ x)
##
## Coefficients:
## (Intercept) x
## -14.800 4.257
\[ Y = -14.8 + 4.26x \]
ggplot(data.frame(x,y), aes(x, y)) +
geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'
\[ f(x, y) = 24x - 6xy^2 - 8y^3 \]
\(f_x = 24 - 6y^2\) \(f_y = -12xy - 24y^2\)
\(24 - 6y^2 = 0 \ \to \ y^2 = 4 \ \to \ y = \pm 2\)
When \(y = 2\): \(-12xy -24y^2 = 0 \ \to \ -24x = 96 \ \to \ x = -4\).
When \(y = -2\): \(-12xy -24y^2 = 0 \ \to \ 24x = 96 \ \to \ x = 4\).
Third coordinate:
\(f(-4,2) = 24(-4) - 6(-4)(2^2) - 8(2^3) =\) -64.
\(f(4,-2) = 24(4) - 6(4)(-2^2) - 8(-2^3) =\) 64.
two critical points = \((-4,2,-64)\) and \((4,-2,64)\).
second derivative test:
\(D(x,y) = f_{xx}f_{yy} - f_{xy}^2\).
\(f_{xx} = 0\).
\(f_{yy} = -12x - 48y\).
\(f_{xy} = f_{yx} = -12y\).
\(D = 0 - (-12y)^2 = -144y^2\).
\(D(x,y) < 0 \ \forall (x,y)\),
Step 1: number of units sold multipled by price
\(R(x,y) = (81 - 21x + 17y)x + (40 + 11x - 23y)y\).
Step 2: Plug in \(x = 2.30\) and \(y = 4.10\).
\(R(2.30, 4.10) = \Big[81 - 21(2.30) + 17(4.10)\Big]\times 2.30 + \Big[40 + 11(2.30) - 23(4.10)\Big]\times 4.10\)
\(R(2.30, 4.10) =\) 116.62.
\(x + y = 96\). find the critical points of \(C(x,y)\), next we must find the local minimum.
\(x = y - 96, \ \ y = 96 - x\).
\[\begin{align*} C(x, 96 - x) &= \frac{1}{6}x^2 + \frac{1}{6}(96 - x)^2 + 7x + 25(96 - x) + 700 \\ &= \frac{1}{6}x^2 + 1536 - 32x + \frac{1}{6}x^2 + 7x + 2400 - 25x + 700 \\ &= \frac{1}{3}x^2 - 50x + 4636 \\ C_x &= \frac{2}{3}x - 50 = 0 \\ x &= 75 \\ C_{xx} &= \frac{2}{3} \end{align*}\]
We are able to see that the second derivative is > 0, then, and there is a local minimum at 75.
the Los Angeles = 75 units, and the Denver plant = 21 units.
\[ \iint \limits_R (e^{8x + 3y})dA; \ \ R: 2 \leq x \leq 4 \ \ \text{and } \ 2 \leq y \leq 4 \]
\[\begin{align*} &\int\limits_{2}^{4} \int\limits_{2}^{4} (e^{8x + 3y}) \ dx \ dy \\ &\int\limits_{2}^{4} e^{8x} \ dx \int\limits_{2}^{4} e^{3y} \ dy \\ &\frac{1}{8}e^{8x}\Big|_{2}^{4} \cdot \frac{1}{3}e^{3y}\Big|_{2}^{4} \\ &\frac{1}{24}(e^{32} - e^{16})(e^{12} - e^{6}) \end{align*}\]
(1/24)*((exp(32) - exp(16))*(exp(12) - exp(6)))
## [1] 5.341559e+17