Load libraries.
library(glue)
( 5.6, 8.8 ), ( 6.3, 12.4 ), ( 7, 14.8 ), ( 7.7, 18.2 ), ( 8.4, 20.8 )
x <- c(5.6, 6.3, 7, 7.7, 8.4)
y <- c(8.8, 12.4, 14.8, 18.2, 20.8)
new_lm <- lm(y ~ x)
slope <- round(coef(new_lm)[2], 2)
intercept <- coef(new_lm)[1]
glue('y = {slope}x + {intercept}')
## y = 4.26x + -14.8
\(f (x, y ) = 24x - 6xy^2 - 8y^3\)
\(f_{x}(x,y) = 24 - 6y^2\)
\(f_{y}(x,y) = -12xy - 24y^2\)
\(24 - 6y^2 = 0\)
y = 2, y = -2
For y = 2 \(-12xy - 24y^2 = -12x(2) - 24(2)^2 = -24x - 96 = 0\)
x = -4
For y = -2 \(-12xy - 24y^2 = -12x(-2) - 24(-2)^2 = 24x - 96 = 0\)
x = 4
So . . . solutions are (-4,2) or (4,-2)
# Define your multivariate function f(x, y)
function1 <- function(x, y) {
return((24 * x) - (6 * x * (y**2)) - (8 * (y**3)))
}
# Generate grid of x and y values
x <- seq(-5, 5, length.out = 100)
y <- seq(-5, 5, length.out = 100)
z <- outer(x, y, function1)
# Plot the function
contour(x, y, z, main = "Contour Plot of f(x, y)")
Based on the graphs above, points (-4,2) and (4,-2) appear to be saddle points, and the function does not contain any relative maxima or minima.
To find z, just plug in the values of x and y.
(24 * -4) - (6*(-4)*(4)) - (8*2*2*2)
## [1] -64
(24 * 4) - (6*(4)*(4)) - (8*-2*-2*-2)
## [1] 64
Step 1. Find the revenue function R ( x, y ).
Revenue = Price x Quantity
R(x,y) = house price * (81 - 21x + 17y) + name price * (40 + 11x - 23y)
\(R(x, y) = 81x - 21x^2 + 17xy + 40y + 11xy - 23y^2\)
Step 2. What is the revenue if she sells the “house” brand for $2.30 and the “name” brand for $4.10?
\(R(2.30, 4.10) = (81 * 2.30) - (21 * (2.30)^2) + (17 * 2.30 * 4.10) + (40 * 4.10) + (11 * 2.30 * 4.10) - (23 * (4.10)^2)\)
= 116.62
\(C(x, y) = \frac {1}{6}x^2 + \frac{1}{6}y^2 + 7x + 25y + 700\)
This question is asking for the maximum (or maxima if more than one maximum exists). To find this, the same process will be used as question 2, but I have to keep in mind that x + y = 96. This means the function can be rewritten as a function of just x or y.
\(C(x) = \frac{1}{6}x^2 + \frac{1}{6}(96 - x)^2 + 7x + 25(96 - x) + 700\)
\(C(x) = \frac{1}{6}x^2 + \frac{1}{6}(9216 - 192x + x^2) + 7x + 2400 - 25x + 700\)
\(C(x) = \frac{1}{6}x^2 + 1536 - 32x + \frac{1}{6}x^2 + 7x + 2400 - 25x + 700\)
\(C(x) = \frac{1}{3}x^2 - 50x + 4636\)
\(C'(x) = \frac{2}{3}x - 50\)
Set this derivative equal to 0 and solve.
\(\frac{2}{3}x - 50 = 0\)
x = 75
This should be the minimum because of the question. I will determine y and then plug them in to find the cost.
Based on the results from below, values less than and greater than (75, 21) will result in a higher cost.
x <- 75
y <- 96 - x
(x^2 / 6) + (y^2 / 6) + (7 * x) + (25 * y) + 700
## [1] 2761
x <- 60
y <- 96 - x
(x^2 / 6) + (y^2 / 6) + (7 * x) + (25 * y) + 700
## [1] 2836
x <- 90
y <- 96 - x
(x^2 / 6) + (y^2 / 6) + (7 * x) + (25 * y) + 700
## [1] 2836
\(\int \int_{R} (e^{8x + 3y}) \ dA \ ; \ R: 2 \leq x \leq 4 \ and \ 2 \leq y \leq 4\)
\(\int_2^4 \int_2^4 (e^{8x+3y}) \ dx \ dy\)
\(\int_2^4 \left[ \int_2^4 (e^{8x+3y}) \ dx \right] \ dy\)
\(\int_2^4 \left[ (e^{8x+3y}) \middle| _2^4 \ \right] \ dy\)
\(\int_2^4 \left[ (e^{8(4)+3y}) - (e^{8(2) + 3y}) \ \right] \ dy\)
\(\int_2^4 \left[ (e^{32+3y}) - (e^{16 + 3y}) \ \right] \ dy\)
\(\left[ \ (e^{32+3y}) - (e^{16 + 3y}) \ \middle|_2^4 \ \right] \ dy\)
\(e^{32+12} - e^{16 + 12} - e^{32 + 6} + e^{16 + 6}\)
\(e^{44} - e^{28} - e^{38} + e^{22}\)
\(e^{44} - e^{28} - e^{38} + e^{22}\)
exp(44) - exp(28) - exp(38) + exp(22)
## [1] 1.281974e+19