Expand {lazy.symbolic}R Documentation

Expand an Expression by Distributing a Multiplicative Factor

Description

Expand an Expression by Distributing a Multiplicative Factor

Usage

Expand(exp, method = 1:2, simplify = 1, debug = 0)

Arguments

exp

Input expression

method

= 1 to expand a*(...)
= 2 to expand (...)*a

simplify

= 0 to skip the simplification of the result

debug

= 1 to print intermediate result

Details

This function will expand a single occurence of a*(b+c) to a*b+a*c and a single occurence of (a+b)*c to a*c+b*c.
Repeated use may expand it further.

Value

Expanded expression

Examples

Expand("a*(b+c)")
Expand("-a*(b+c)")

Expand("(a+b)*(F(x)-G(y))")

Expand("-a*(b-c)*(d+e)")
Expand(.Last.value)

Expand( "((+a*(b-c*d)*e+f)*g)*h - (((+a*b-c*d)*e+f)*g)*h" )
Expand(.Last.value)


[Package lazy.symbolic version 0.1.3 Index]