Mathematica 9 is now available

Distribute

Usage

Distribute[f[ ,  , ... ]]f 分配到出现在任意 中的Plus上.
Distribute[expr, g] 分配到g.
• 只用expr 的头为f时,Distribute[expr, g, f] 才进行分配.


Notes

Distribute有效地实现了算子 fg的分配律.
Distribute明确建立一个分布的完整结果;相反地, Expand只简单地在每一阶段重复建立结果.
• 例如: Distribute[f[a+b,c+d]]LongRightArrow .
Distribute[f[a+b,g[x,y],c], g]LongRightArrow .
Distribute[expr, g, f, gp, fp]在分配结果中分别使用 gpfp来代替 gf.
• 参见Mathematica全书: 2.2.10.
• 同时参见: Expand, Thread, Outer, Inner.
Further Examples

This expresses the classic distributive law of multiplication over addition.

In[1]:=  

Out[1]=

Here is an equivalent way to write the input.

In[2]:=  

Out[2]=

This is how taking a power distributes over addition.

In[3]:=  

Out[3]=

We can generalize this to an arbitrary function.

In[4]:=  

Out[4]=

Here we distribute over a product instead of a sum (two variations).

In[5]:=  

Out[5]=

In[6]:=  

Out[6]=

This example is similar to ComplexExpand. (In ComplexExpand the exponent has to be a number.)

In[7]:=  

Out[7]=

In[8]:=  

Out[8]=

Subsums of a list gives all the possible sums of sublists of the list.

In[9]:=  

In[10]:=  

Out[10]=

In[11]:=  



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.