\[f(x)= 1 / \sqrt (2 * \pi)* \exp (-1/2 * x^2)\]
f <- function(x) {
return(1 / sqrt(2 * pi) * exp(-1/2 * x^2))
}
x_valores <- seq(-3, 3, length.out = 100)
y_valores <- f(x_valores)
plot(x_valores, y_valores, type = "l", col = "blue", lwd = 2,
main = "Función de Densidad Gaussiana",
xlab = "x", ylab = "f(x)")
legend("topright", legend = expression(f(x) == frac(1, sqrt(2*pi)) ~ e^(-frac(1,2)*x^2)),
col = "blue", lwd = 2, cex = 0.8)
\[r(\theta)= \exp(\sin(\theta)) - 2\cos(4\theta) + \sin^5(2\theta- \pi/24)\]
r <- function(theta) {
return(exp(sin(theta)) - 2 * cos(4 *theta) + sin(2 * theta - pi/24)^5)
}
theta_valores <- seq(0, 2 * pi, length.out = 500)
r_valores <- r(theta_valores)
plot(theta_valores, r_valores, main = "Gráfico de r(theta)",
col = "blue", lwd = 2)
\[y= ax^2 + bx + c\]
a <- 1
b <- -2
c <- 1
x_valores <- seq(-10, 10, length.out = 100)
y_valores <- a * x_valores^2 + b * x_valores + c
plot(x_valores, y_valores, type = "l", col = "blue", lwd = 2,
main = "Gráfico de la Parábola",
xlab = "x", ylab = "y")
legend("topright", legend = expression(y == ax^2 + bx + c),
col = "blue", lwd = 2, cex = 0.8)