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.
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 all close allBasic Examples (3)
Distribute[(a + b).(x + y + z)]Distribute f over Plus:
Distribute[f[a + b, c + d + e]]Distribute[f[g[a, b], g[c, d, e]], g]Scope (4)
By default, distribute over Plus:
Distribute[(a + b + c)(u + v), Plus]Distribute[(a + b + c)(u + v)]Distribute only a product of sums:
Distribute[(a + b + c)(u + v), Plus, Times]Distribute[(a + b + c) ^ (u + v), Plus, Times]Distributive laws for logical operators:
Distribute[And[Or[a, b, c], Or[u, v]], Or, And]Distribute[Or[And[a, b, c], And[u, v]], And, Or]Distribute[And[Xor[a, b, c], Xor[u, v]], Xor, And]Apply the distributive law to arbitrary operators:
Distribute[(a⊕b⊕c)⊗(u⊕v), CirclePlus, CircleTimes]Generalizations & Extensions (1)
Applications (5)
Expand symbolic matrix and vector expressions:
Distribute[(m1 + m2).(m3 + m4)]Distribute[(v1 + v2)⨯(v3 + v4)]Apply the distributive law with any operator:
Distribute[(a + b)⊕(x + y + z)⊕(s + t)]Find the list of all possible combinations of elements:
Distribute[{{a, b}, {x, y, z}, {s, t}}, List]Distribute[{{}, {#}}& /@ {a, b, c}, List, List, List, Join]Find intermediate terms from a direct application of the distributive law:
Distribute[Factor[x ^ 6 - 1], Plus, Times, List, Times]Plus@@%Properties & Relations (3)
For pure products, Distribute gives the same results as Expand:
Factor[x ^ 10 - 1]Distribute[%]PowerExpand corresponds to distribution over Times:
PowerExpand[(x y z) ^ n]Distribute[(x y z) ^ n, Times]Outer forms the same combinations of all elements, but in a nested structure:
Outer[List, {a, b, c}, {x, y}]Distribute[{{a, b, c}, {x, y}}, List]Possible Issues (2)
This use of Distribute does not give the expected result:
Distribute[(a + b) * (a + b)]The reason is that the argument is evaluated first and the product vanishes:
(a + b) * (a + b)Distribute[%]Prevent evaluation of the argument before Distribute sees it:
Distribute[Unevaluated[(a + b) * (a + b)]]Distribute does not necessarily give a mathematically correct result:
Distribute[u ^ (a + b)]Restrict the application to occurrences of Times to avoid the transformation:
Distribute[u ^ (a + b), Plus, Times]Tech Notes
Related Guides
Related Links
History
Introduced in 1988 (1.0)
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
BibTeX
@misc{reference.wolfram_2026_distribute, author="Wolfram Research", title="{Distribute}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Distribute.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_distribute, organization={Wolfram Research}, title={Distribute}, year={1988}, url={https://reference.wolfram.com/language/ref/Distribute.html}, note=[Accessed: 13-June-2026]}