Realiza la gráfica de las siguientes funciones en el intervalo adecuado.
- \(e^x-3x^2=0\) para \(0\leq x \leq 1\) y \(3\leq x \leq 5\).
f_a <- function(x){exp(x)-3*x^2}
x_a <- seq(0, 5, by=0.1)
y_a <- f_a(x_a)
graf_a <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_a, y=y_a), color="blue", size=1)+
labs(x="x", y="f(x)", title="Primera gráfica")+
theme_bw()
ggplotly(graf_a)## Warning: `gather_()` was deprecated in tidyr 1.2.0.
## Please use `gather()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
b)\(f(x)=\frac{2x^2-8}{x+2}\)
f_b <- function(x){(2*x^2-8)/(x+2)}
x_b <- seq(-5, 5, by=1)
y_b <- f_b(x_b)
graf_b <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_b, y=y_b), color="purple", size=0.5)+
labs(x="x", y="f(x)", title="Gráfica b")+
theme_bw()
ggplotly(graf_b)c)\(f(x)=\frac{x+1}{x+2}\)
f_c <- function(x){(x+1)/(x+2)}
x_c <- seq(-5, 5, by=0.01)
y_c <- f_c(x_c)
graf_c <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_c, y=y_c), color="orange", size=0.5)+
labs(x="x", y="f(x)", title="Gráfica c")+
theme_bw()
ggplotly(graf_c)- \(f(x)=3x+1\)
f_d <- function(x){3*x+1}
x_d <- seq(-10, 10, by=1)
y_d <- f_d(x_d)
graf_d <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_d, y=y_d), color="green", size=1)+
labs(x="x", y="f(x)", title="Gráfica d")+
theme_bw()
ggplotly(graf_d)- \(f(x)=x^4-x^3+x^2-x+1\).
f_e <- function(x){x^4-x^3+x^2-x+1}
x_e <- seq(-40, 40, by=1)
y_e <- f_e(x_e)
graf_e <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_e, y=y_e), color="green", size=1)+
labs(x="x", y="f(x)", title="Gráfica e")+
theme_bw()
ggplotly(graf_e)- \(f(x)=x\,cos\,x-3x\).
f_f <- function(x){x*cos (x)-3*x}
x_f <- seq(-100, 100, by=1)
y_f <- f_f(x_f)
graf_f <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_f, y=y_f), color="orange", size=1)+
labs(x="x", y="f(x)", title="Gráfica f")+
theme_bw()
ggplotly(graf_f)- \(f(x)=e^{2x}\).
f_g <- function(x){exp(2*x)}
x_g <- seq(-4, 4, by=1)
y_g <- f_g(x_g)
graf_g <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_g, y=y_g), color="orange", size=1)+
labs(x="x", y="f(x)", title="Gráfica g")+
theme_bw()
ggplotly(graf_g)- \(f(x)=log(e^x+2)\).
f_h <- function(x){log(exp(x)+2)}
x_h <- seq(-10, 10, by=1)
y_h <- f_h(x_h)
graf_h <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_h, y=y_h), color="orange", size=1)+
labs(x="x", y="f(x)", title="Gráfica h")+
theme_bw()
ggplotly(graf_h)- \(f(x) = cos \,x+sen\,x\).
f_i <- function(x){cos(x)+sin(x)}
x_i <- seq(-100, 100, by=10)
y_i <- f_i(x_i)
graf_i <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_i, y=y_i), color="orange", size=1)+
labs(x="x", y="f(x)", title="Gráfica i")+
theme_bw()
ggplotly(graf_i)- \(f(x)=sen(e^x-2)\).
f_j <- function(x){sin(exp(x)-2)}
x_j <- seq(-10, 10, by=0.1)
y_j <- f_j(x_j)
graf_j <- ggplot()+
geom_vline(xintercept = 0, linetype="dashed")+
geom_hline(yintercept = 0, linetype="dashed")+
geom_line(aes(x=x_j, y=y_j), color="orange", size=1)+
labs(x="x", y="f(x)", title="Gráfica j")+
theme_bw()
ggplotly(graf_j)