# 数値微分(中心差分) # 関数 f <- function(x) { return(x ^ 5 - 4 * x ^ 4) } # 中心差分 f2 <- function(x, h) { return((f(x + h) - f(x - h)) / (2 * h)) } # 中心差分のグラフ h <- 1e-1 curve(f2(x, h), xlim = c(-1, 3), ylab = "y")