Trying to optimize a equation in the interval 1 to 4 but the minimum value of x and y is coming out to be wrong.
x <- seq(from=1, to=4, by=0.1)
y <- ((x^2)+(54/x))
df <- data.frame(x,y)
library(ggplot2)
ggplot(df,aes(x,y))+geom_line()
optimize(y, interval = c(1,4))
RStudio window with code equation graph and minimum values of x and y
