f <- function(x) log(x + log(x)) / log(1 + x)
# Plotting the function
curve(f(x), from = 2, to = 15, ylab = "f(x)")
# Finding the maximum
res <- optimize(f, lower = 4, upper = 8, maximum = TRUE)
abline(v=res$maximum, col = "red", lwd = 2)
[1] 5.792299