There are several ways to do this, but it can be a little more complicated and depends on the structure of your actual expression. However, usually the product of several terms in brackets will have a Times head, and you can use FullForm to check this:
In[1]:= FullForm[(a+b)(c+d)] Out[1]= Times[Plus[a, b], Plus[c, d]]
You can use the higher-order Map function with expressions with head Times same way you use it with expressions with head List , and this can allow you to Simplify express one member at a time, for example:
Map[Simplify, yourGinormousExpression]
You can use the Expand result if you need to expand the brackets afterwards.
EDIT to add:. If you want to specify the forms you want to simplify, you can use Replace or ReplaceAll instead of one of the Map siblings. Replace especially useful because it requires level specification , allowing only factors to be influenced in the topmost product. As a simple example, consider the following:
In[1]:= expr = Sqrt[(a + 1)/a] Sqrt[(b + 1)/b]; In[2]:= Simplify[expr] Out[2]= Sqrt[1 + 1/a] Sqrt[1 + 1/b]
If you do not want to simplify factors that depend on a . you can do this instead:
In[3]:= Replace[expr, form_ /; FreeQ[form, a] :> Simplify[form], {1}] Out[3]= Sqrt[(1 + a)/a] Sqrt[1 + 1/b]
Only the second term is changed, which depends on b . It should be borne in mind, however, that some conversions are performed automatically using Times or Plus ; for example, a + a will be converted to 2 a even without using Simplify .
Pillsy
source share