- 微分・積分
- expressionというモードのオブジェクトは数式を格納する
- こちら
help(deriv)
trig.exp <- expression(sin(cos(x + y^2)))
D.scx <- D(trig.exp, "x")
D.scx2 <- deriv(trig.exp,"x")
D.scy <- D(trig.exp, "y")
dxy <- deriv(trig.exp, c("x", "y"))
dxyfx<-deriv(trig.exp,c("x","y"),func=TRUE)
dxyfx(0,1)
x<-seq(from=0,to=10,by=0.01)
y<-seq(from=0,to=20,by=0.01)
xy<-expand.grid(x,y)
derivXYout<-dxyfx(xy[,1],xy[,2])
image(x,y,matrix(derivXYout,length(x),length(y)))
integrate(dnorm, -1.96, 1.96)
integrate(dnorm, -Inf, Inf)
integrand <- function(x) {1/((x+1)*sqrt(x))}
integrate(integrand, lower = 0, upper = Inf)