Chapter 4.3 Find the maximum product of two numbers (not necessarily integers) that have a sum of 100.
fx <- function(x) { x * (100-x) } fx1 <- Deriv(fx) root <- uniroot(fx1, c(100, -100)) fx(root$root)
## [1] 2500
root$root
## [1] 50