independent <- c(5.6, 6.3, 7, 7.7, 8.4)
dependent <- c(8.8, 12.4, 14.8, 18.2, 20.8)
model <- lm(dependent ~ independent)
summary(model)
##
## Call:
## lm(formula = dependent ~ independent)
##
## 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 ***
## independent 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
Solution:
\(y=-14.80 + 4.26x\)
\(f(x,y) = 24x - 6xy^2 - 8y^3\)
f=expression(24*x - 6*x*y^2 - 8*y^3)
fx <- D(f,'x')
Simplify(fx)
## 24 - 6 * y^2
fy <- D(f,'y')
Simplify(fy)
## -(y * (12 * x + 24 * y))
Solve for y
\(0 = 24 - 6y^2\)
\(6y^2 = 24\)
\(6y^2 = 24\)
\(y^2 = 4\)
\(y \pm 2\)
Solve for x
\(0 = -12y (x+2y)\)
\(0 = -12yx -24y^2\)
\(12yx = -24y^2\)
\(x = \frac{-24y^2}{12y}\)
\(x = -2y\)
\(x = -2(\pm2)\)
\(x \pm 4\)
fxx <- D(D(f,'x'),'x')
Simplify(fxx)
## [1] 0
fxy <- D(D(f,'x'),'y')
Simplify(fxy)
## -(12 * y)
fyy <- D(D(f,'y'),'y')
Simplify(fyy)
## -(12 * x + 48 * y)
\(0 * -12(x+4y) - (-12y)^2\)
\(-144y^2\)
Evaluated at with 2 and -2 (x is ignored due to no term) the result is: -576.
Since, -576 is less than zero, (-4, 2) and (4, -2) are saddle points.
There is no local maxima or local minima.
Step 1. Find the revenue function R ( x, y ).
house <- expression(81-21*x+17*y)
name <- expression(40 + 11*x - 23*y)
house_and_name <- expression(x*(81-21*x+17*y) + y*(40 + 11*x - 23*y))
Simplify(house_and_name)
## expression(x * (17 * y + 81 - 21 * x) + y * (11 * x + 40 - 23 *
## y))
Expanding out… \(17xy + 81x - 21x^2 + 11xy + 40y - 23y^2\)
Revenue function is: \(28xy + 81x - 21x^2 + 40y - 23y^2\)
Step 2. What is the revenue if she sells the “house” brand for $2.30 and the “name” brand for $4.10?
x <- 2.3
y <- 4.1
x*(81 - 21*x + 17*y) + y*(40 + 11*x - 23*y)
## [1] 116.62
Cost function is:
\(\frac{1}{6} x^2 + \frac{1}{6} y^2 + 7x + 25y + 700\)
Required output per week can be defined as: \(x + y = 96\)
Which we can rewrite as: \(x = 96 - y\)
Let’s substitute the expression above for x:
\(\frac{1}{6} (96 - y)^2 + \frac{1}{6} y^2 + 7(96 - y) + 25y + 700\)
Which simplifies to:
\(1536 - 32y + \frac{1}{6}y^2 + \frac{1}{6} y^2 + 672 - 7y + 25y + 700\)
\(2908 - \frac{1}{3}y^2 - 14y\)
Let’s take the first derivative to find minimum cost…
f <- expression(2908 - (1/3)*y^2-14*y)
fx <- D(f,'y')
Simplify(fx)
## -(0.666666666666667 * y + 14)
\(0 = -\frac{2}{3}y - 14\)
Solve for y:
\(y = 21\)
Therefore, if 21 units should be produced in Denver..
\(x + 21 = 96\)
Then, the amount of units produced in Los Angeles should be:
\(x = 75\)
\(\int_{2}^{4} \int_{2}^{4} e^{8x+3y} \,dx dy\)
Apply u-substitution
u = \(8x+3y\)
Take derivative with respect to x:
\(8+0\)
\(\frac{du}{dx} = 8+0\)
\(dx = \frac{1}{8}du\)
Now plug in 2 and 4 to u for adjusted boundaries:
\(8(2) + 3y = 16 + 3y\)
\(8(4) + 3y = 32 + 3y\)
The updated double integral becomes:
\(\int_{16 + 3y}^{32 + 3y} e^u \frac{1}{8} \,du\)
Move the constant to the front:
\(\frac{1}{8} \int_{16 + 3y}^{32 + 3y} e^u \,du\)
\(\frac{1}{8} (e^{32 + 3y} - e^{16 + 3y}) \,du\)
\(\int_{2}^{4} \frac{1}{8} (e^{32 + 3y} - e^{16 + 3y}) \,dy\)
Apply sum rule
\(\frac{1}{8} \int_{2}^{4} e^{32 + 3y} - \int_{2}^{4}e^{16 + 3y} \,dy\)
Apply u-substitution
u = \(32 + 3y\)
Take derivative with respect to y:
\(0+3\)
\(\frac{du}{dy} = 0+3\)
\(dy = \frac{1}{3}du\)
Now plug in 2 and 4 to u for adjusted boundaries:
\(32 + 3(2) = 38\)
\(32 + 3(4) = 44\)
The updated double integral becomes:
\(\int_{38}^{44} e^u \frac{1}{3} \,du\)
\(\frac{1}{3} (e^{44} - e^{38})\)
Apply u-substitution
u = \(16 + 3y\)
Take derivative with respect to y:
\(0+3\)
\(\frac{du}{dy} = 0+3\)
\(dy = \frac{1}{3}du\)
Now plug in 2 and 4 to u for adjusted boundaries:
\(16 + 3(2) = 22\)
\(16 + 3(4) = 28\)
The updated double integral becomes:
\(\int_{22}^{28} e^u \frac{1}{3} \,du\)
\(\frac{1}{3} (e^{28} - e^{22})\)
Now combine:
\((e^{44} - e^{38}) - (e^{28} - e^{22})\)
\(e^{44} - e^{38} - e^{28} + e^{22}\)
Insert the constants:
\(\frac{1}{8}(\frac{1}{3}(e^{44} - e^{38} - e^{28} + e^{22}))\)