discussion question

  • land cost = \(50000(5-x)\)
  • water cost= \(80000(\sqrt{x^2+4})\)
  • total_cost= land cost + water cost
  • total underground= 3.399
max=5
min=0
library(Deriv)
my_eq <- function(x) {50000*(5-x)+80000*sqrt(x^2+4)}

my_eq_prime <- Deriv(my_eq)
uniroot(my_eq_prime, c(min, max))
## $root
## [1] 1.601298
## 
## $f.root
## [1] 0.3101069
## 
## $iter
## [1] 6
## 
## $init.it
## [1] NA
## 
## $estim.prec
## [1] 6.103516e-05
my_eq(1.601)
## [1] 374900
my_eq(5)
## [1] 430813.2