Distribute
Distribute[f[x1,x2,…]]
distributes f over Plus appearing in any of the xi.
Distribute[expr,g]
distributes over g.
Distribute[expr,g,f]
performs the distribution only if the head of expr is f.
Details
- Distribute effectively implements the distributive law for operators f and g.
- Distribute explicitly constructs the complete result of a distribution; Expand, on the other hand, builds up results iteratively, simplifying at each stage.
- Distribute[expr,g,f,gp,fp] gives gp and fp in place of g and f respectively in the result of the distribution. »
Examples
open allclose allBasic Examples (3)
Scope (4)
By default, distribute over Plus:
Distribute only a product of sums:
Applications (5)
Properties & Relations (3)
For pure products, Distribute gives the same results as Expand:
PowerExpand corresponds to distribution over Times:
Outer forms the same combinations of all elements, but in a nested structure:
Possible Issues (2)
This use of Distribute does not give the expected result:
The reason is that the argument is evaluated first and the product vanishes:
Prevent evaluation of the argument before Distribute sees it:
Distribute does not necessarily give a mathematically correct result:
Restrict the application to occurrences of Times to avoid the transformation:
Text
Wolfram Research (1988), Distribute, Wolfram Language function, https://reference.wolfram.com/language/ref/Distribute.html.
CMS
Wolfram Language. 1988. "Distribute." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Distribute.html.
APA
Wolfram Language. (1988). Distribute. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Distribute.html