1) Funciones de una variable

#a) y=16+2x #b) y=8−2x #c) y=2x+12

Dominio

x <- seq(0, 20, length = 100)

(a) y = 16 + 2x

f1 <- function(x) 16 + 2*x

h <- seq(0, 60, length = 13)
v <- seq(0, 20, length = 11)

plot(f1, x, main = “y = 16 + 2x”, xlim = c(0, 20), col = “red”, lwd = 3, xlab = “x”, ylab = “y”) abline(v = v, h = h, lty = 2, col = “orange”)

2) Funciones de dos variables

#A) z=x2+y2 #B) Grafique en 3D y obtenga las isocuantas de las siguientes funciones. #C) Sustitutos perfectos

A)z = x^2 + y^2

x <- seq(0, 50, length = 100) y <- seq(0, 50, length = 100)

Z <- outer(x, y, function(x, y) x^2 + y^2)

B) Grafica 3D

persp(x, y, Z, main = “z = x^2 + y^2”, theta = 30, phi = 30, col = “lightgreen”, expand = 0.5)

Isocuantas

contour(x, y, Z, main = “Isocuantas - z = x^2 + y^2”, xlab = “x”, ylab = “y”)

C) Sustitutos perfectos: u(x1,x2) = x1 + x2

x_1 <- seq(0, 50, length = 100) x_2 <- seq(0, 50, length = 100)

U_SP <- outer(x_1, x_2, function(x_1, x_2) x_1 + x_2)

Grafica 3D

persp(x_1, x_2, U_SP, main = “Sustitutos perfectos: u(x1,x2) = x1 + x2”, theta = 30, phi = 30, col = “lightblue”, expand = 0.5)

Isocuantas

contour(x_1, x_2, U_SP, main = “Isocuantas - Sustitutos perfectos”, xlab = “x1”, ylab = “x2”)