https://open.umn.edu/opentextbooks/textbooks/198 Pg. 386 Section 7.4 Q6

Find the arc length of the function; \(f(x) = \frac{1}{12}x^3 + \frac{1}{x}\) on the interval \([1,4]\)

library(pracma)
## Warning: package 'pracma' was built under R version 4.3.2
# Plot
fun <- function(x) ((1/12)*x^3 + (1/x))
x <- seq(1,4,1)
plot(x,fun(x), type="l",xlab="x", ylab="f(x)")

# calculate
F <- function(x) c(x, fun(x)) 
arclength(F, a=1, b=4)
## $length
## [1] 6
## 
## $niter
## [1] 6
## 
## $rel.err
## [1] 4.347424e-06