Simplification

Simplification

The following functions are used to simplify expressions.

Base.floatFunction.
float(expr)

Convert rational numbers into floating point numbers in expression.

Examples

julia> float(m"1/3*x")

                             0.3333333333333333 x
source
Maxima.demoivreFunction.
demoivre(expr)

Break exponential terms into hyperbolic and trigonometric functions. Roughly the opposite in function to exponentialize

Examples

julia> demoivre(m"exp(a + %i * b)")

                             a
                           %e  (%i sin(b) + cos(b))

julia> exponentialize(ans)

                         %i b     - %i b     %i b     - %i b
                    a  %e     + %e         %e     - %e
                  %e  (----------------- + -----------------)
                               2                   2

julia> expand(ans)

                                    %i b + a
                                  %e
source
Maxima.expandFunction.
expand(expr)

Expand expression.

Examples

julia> expand(m"(a + b)^2")

                                 2            2
                                b  + 2 a b + a
source
Maxima.exponentializeFunction.
exponentialize(expr)

Express expression in terms of exponents as much as possible

Examples

julia> exponentialize(m"sin(x)")

                                   %i x     - %i x
                             %i (%e     - %e      )
                           - ----------------------
                                       2
source
Maxima.factorFunction.
factor(expr::T) where T

Factorize polynomial expression

Examples

julia> factor(:(x^2 + 2x + 1))
:((x + 1) ^ 2)

julia> factor(MExpr("a^2 - b^2"))

                                (a - b) (b + a)
source
Maxima.gfactorFunction.
gfactor(expr::T) where T

Factorize complex polynomial expression

Examples

julia> gfactor(:(z^2 + 2*im*z - 1))
:((z + im) ^ 2)
source
Maxima.imagpartFunction.
imagpart(expr)

Find the imaginary part of a complex expression.

Examples

julia> realpart(MExpr("a + %i*b"))

                            b
source
Maxima.logcontractFunction.
logcontract(expr::T) where T

Contract logarithms in expression

source
Maxima.logexpandFunction.
logexpand(expr::T) where T

Expand logarithm terms in an expression

source
Maxima.makefactFunction.
makefact(expr::T) where T

Convert expression into factorial form.

source
Maxima.makegammaFunction.
makegamma(expr::T) where T

Convert factorial to gamma functions in expression

source
Maxima.polarformFunction.
polarform(expr)

Put a complex expression into polarform

Examples

julia> polarform(m"a + %i*b")

                              2    2    %i atan2(b, a)
                        sqrt(b  + a ) %e
source
Maxima.radcanFunction.
radcan(expr::T) where T

Simplify radicals in expression.

Examples

julia> radcan(:(sqrt(x/y)))
:(sqrt(x)/sqrt(y))

julia> radcan(m"sqrt(x/y)")

                                    sqrt(x)
                                    -------
                                    sqrt(y)
source
Maxima.ratsimpFunction.
ratsimp(expr::T) where T

Simplify expression.

Examples

julia> ratsimp("a + b/c")
"(a*c+b)/c"

julia> ratsimp(:(sin(asin(a + b/c))))
:((a * c + b) / c)

julia> ratsimp(m"%e^log(x)")

                                       x
source
Maxima.realpartFunction.
realpart(expr)

Find the real part of a complex expression

Examples

julia> realpart(MExpr("a + %i*b"))

                            a
source
Maxima.rectformFunction.
rectform(expr)

Put complex expression in rectangular form

Examples

julia> rectform(:(R*e^(im*θ)))
:(R * im * sin(θ) + R * cos(θ))

source
Maxima.substFunction.
subst(a, b, expr)

Replace a with b in expr.

Examples

julia> subst(:b, :a, :(a^2 + b^2))
:(2 * b ^ 2)
source
Maxima.trigexpandFunction.
trigexpand(expr)

Expand out trig functions in expression

source
Maxima.trigratFunction.
trigrat(expr)

Convert expression into a canonical trigonometric form

Examples

julia> trigrat(:(exp(im*x) + exp(-im*x)))
:(2 * cos(x))
source
Maxima.trigreduceFunction.
trigreduce(expr)

Contract trigonometric functions

source
Maxima.trigsimpFunction.
trigsimp(expr::T) where T

Simplify trigonometric expression

Examples

julia> trigsimp(m"sin(x)^2 + cos(x)^2")

                                       1
source