INFINITY -数学とかプログラミングとか-

統計とプログラムを使って役に立たせたい

TeX用コマンド入力を支援するための辞書をご利用ください。
sanctuary's blogは,適当なことが書いてあります。

Integrate[Exp[-(s^2/2)]*Cosh[s], {s, -Infinity, Infinity}]

は、\sqrt{2 e \pi}

s=seq(-5,5,,1000)
plot(s,exp(-log(2)-2*log(cosh(s))),xlim=c(-5,5),ylim=c(0,0.8),type="l")
par(new=T)
plot(s,(1/sqrt(2))*exp(-sqrt(2)*abs(s)),xlim=c(-5,5),ylim=c(0,0.8),type="l")


x=seq(-5,5,,1000)
plot(x,f(x),xlim=c(-5,5),ylim=c(0,2),type="l")
par(new=T)
plot(x,dunif(x, min=-sqrt(3), max=sqrt(3), log = FALSE),xlim=c(-5,5),ylim=c(0,0.4),type="l")
par(new=T)
g = function(x) exp(-(1/2)*log(2*exp(1)*Pi)-(s^2/2)+log(cosh(s)))
plot(x,g(x),xlim=c(-5,5),ylim=c(0,0.4),type="l")