Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know if this is what you expected but maxima can integrate the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate);
                   5/2                      3/2             3/2
(%o7) (sqrt(%pi) (2    sigma log(sigma) + (2    log(%pi) + 2    log(2)) sigma)
                                    3/2                    5/2
                                 + 2    sqrt(%pi) sigma)/(2    sqrt(%pi) sigma)

I don't know if this is what you expected but maxima can integrate the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate);
                   5/2                      3/2             3/2
(%o7) (sqrt(%pi) (2    sigma log(sigma) + (2    log(%pi) + 2    log(2)) sigma)
                                    3/2                    5/2
                                 + 2    sqrt(%pi) sigma)/(2    sqrt(%pi) sigma)

If ex is sageized version of the last expression then

sage: ex.full_simplify()
1/2*log(pi) + 1/2*log(2) + log(sigma) + 1/2

I don't know if this is what you expected but maxima can integrate compute the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate);
                   5/2                      3/2             3/2
(%o7) (sqrt(%pi) (2    sigma log(sigma) + (2    log(%pi) + 2    log(2)) sigma)
                                    3/2                    5/2
                                 + 2    sqrt(%pi) sigma)/(2    sqrt(%pi) sigma)

If ex is sageized version of the last expression then

sage: ex.full_simplify()
1/2*log(pi) + 1/2*log(2) + log(sigma) + 1/2

I don't know if this is what you expected but maxima can compute the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate);
                   5/2                      3/2             3/2
(%o7) (sqrt(%pi) (2    sigma log(sigma) + (2    log(%pi) + 2    log(2)) sigma)
                                    3/2                    5/2
                                 + 2    sqrt(%pi) sigma)/(2    sqrt(%pi) sigma)

If ex is sageized version of the last expression then

sage: ex.full_simplify()
1/2*log(pi) + 1/2*log(2) + log(sigma) + 1/2

and the last expression is equal: log(sqrt(2pi)sigma)+1/2

I don't know if this is what you expected but maxima can compute the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate);
                   5/2                      3/2             3/2
(%o7) (sqrt(%pi) (2    sigma log(sigma) + (2    log(%pi) + 2    log(2)) sigma)
                                    3/2                    5/2
                                 + 2    sqrt(%pi) sigma)/(2    sqrt(%pi) sigma)

If ex is sageized version of the last expression then

sage: ex.full_simplify()
1/2*log(pi) + 1/2*log(2) + log(sigma) + 1/2

and the last expression is equal: log(sqrt(2pi)sigma)+1/2 log(sqrt(2*pi)*sigma)+1/2

I don't know if this is what you expected but maxima can compute the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate);
                   5/2 ev(%,integrate)$
(%i8) ratsimp(%);
 3/2 2 log(sigma) + log(%pi) + log(2) + 1
(%o8)  3/2
(%o7) (sqrt(%pi) (2  sigma log(sigma) + (2    log(%pi) + 2    log(2)) sigma)
------------------------------------
 3/2                   5/2
                                 + 2    sqrt(%pi) sigma)/(2    sqrt(%pi) sigma)

If ex is sageized version of the last expression then

sage: ex.full_simplify()
1/2*log(pi) + 1/2*log(2) + log(sigma) + 1/2
2

and the last expression is equal: log(sqrt(2*pi)*sigma)+1/2

I don't know if this is what you expected but maxima can compute the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate)$
(%i8) ratsimp(%);
                     2 log(sigma) + log(%pi) + log(2) + 1
(%o8)                ------------------------------------
                                      2
(%i9) logcontract(%);

                                            2
                             log(2 %pi sigma ) + 1
(%o9)                        ---------------------
                                       2

and the last expression is equal: log(sqrt(2*pi)*sigma)+1/2

I don't know if this is what you expected but maxima Maxima can compute the entropy

sage:maxima_console()

(%i1) dispay2d:false;
(%o1)                                false
(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate)$
(%i8) ratsimp(%);
                     2 log(sigma) + log(%pi) + log(2) + 1
(%o8)                ------------------------------------
display2d:false$  2


(%i2) q:1/((2*%pi)^(1/2)*sigma)*exp(-(x - mu)^2/(2*sigma^2))$

(%i3) assume(sigma>0)$

(%i4) assume(mu>0)$

(%i5) ii:integrate(-q*log(q),x,minf,inf)$

(%i6) changevar(ii,(x-mu)/(sqrt(2)*sigma)-y,y,x)$

(%i7) ev(%,integrate)$

(%i8) ratsimp(%);

(%o8) (2*log(sigma)+log(%pi)+log(2)+1)/2
(%i9) logcontract(%);

                                            2
                             log(2 %pi sigma ) + 1
(%o9)                        ---------------------
                                       2
(log(2*%pi*sigma^2)+1)/2

and the last expression is equal: equal to:

log(sqrt(2*pi)*sigma)+1/2