Closed szcf-weiya closed 2 years ago
julia> @vars x
(x,)
julia> exp(-x^2/2)/sqrt(2pi)
2
-x
────
2
0.398942280401433⋅ℯ
julia> f(x) = exp(-x^2/2)/sqrt(2pi)
f (generic function with 1 method)
julia> integrate(f(x), x)
⎛√2⋅x⎞
0.199471140200716⋅√2⋅√π⋅erf⎜────⎟
⎝ 2 ⎠
julia> integrate(f(x), (x, -Inf, Inf))
0.398942280401433⋅√2⋅√π
julia> integrate(x*f(x), (x, -Inf, Inf))
0
julia> integrate(x*f(x), x)
2
-x
────
2
-0.398942280401433⋅ℯ
julia> integrate(x*f(x), (x, -Inf, Inf))
0
julia> integrate(f(x)^2, (x, -Inf, Inf))
0.159154943091895⋅√π
julia> integrate(f(x)^2, x)
0.0795774715459477⋅√π⋅erf(x)
where erf
is the https://en.wikipedia.org/wiki/Error_function
SymPy
http://mth229.github.io/symbolic.html it is required to install
sympy