Function Repository Resource:

# DisplayPowersTogether

Display multiplication and/or division of factors with the form x^y as one factor

Contributed by: Ted Ersek
 ResourceFunction["DisplayPowersTogether"][expr] displays the multiplication and/or division of factors with the form xyor Surd[x,n] as one factor. ResourceFunction["DisplayPowersTogether"][expr,assume] uses assume as assumptions.

## Details and Options

ResourceFunction["DisplayPowersTogether"] automatically combines factors at all levels of an expression.
Powers are displayed as one factor when valid under assuptions given by \$Assumptions.
ResourceFunction["DisplayPowersTogether"][expr,assume] combines assume with \$Assumptions.
CubeRoot[x] evaluates to Surd[x,3], which is affected by ResourceFunction["DisplayPowersTogether"].
The output of ResourceFunction["DisplayPowersTogether"] is a Defer object, which displays with the powers together. Evaluating the Defer object can result in powers seperating.

## Examples

### Basic Examples (4)

Combine the powers in an expression:

 In[1]:=
 Out[1]=

Combine powers with multiple terms:

 In[2]:=
 Out[2]=

 In[3]:=
 Out[3]=

DisplayPowersTogether also combines products and quotients that include CubeRoot:

 In[4]:=
 Out[4]=

### Scope (9)

DisplayPowersTogether combines exponents using the default assumptions stored in \$Assumptions. The assumptions in this example are sufficient to combine all the exponents:

 In[5]:=
 Out[6]=

DisplayPowersTogether similarly combines all the exponents when is given as a second argument in DisplayPowersTogether:

 In[7]:=
 Out[8]=

Provide assumptions allowing some but not all exponents to be combined:

 In[9]:=
 Out[9]=

Set \$Assumptions as a>0, and specify d>0 as an assumption within DisplayPowersTogether:

 In[10]:=
 Out[11]=

Only assume d> 0:

 In[12]:=
 Out[13]=

The following assumptions are sufficient to combine all the exponents even though nothing is assumed about b or z:

 In[14]:=
 Out[14]=

FullSimplify verifies that DisplayPowersTogether performed a valid transformation under the given assumptions:

 In[15]:=
 Out[15]=

This performs independent verification by searching for a counterexample to the previous example. The identity is True in every case considered:

 In[16]:=
 Out[16]=

In this case, nothing is assumed and none of the exponents can be combined:

 In[17]:=
 Out[17]=

DisplayPowersTogether determines this can be done with a single Sqrt:

 In[18]:=
 Out[18]=

Surd is a generalization of CubeRoot. DisplayPowersTogether combines expressions involving Surd when appropriate:

 In[19]:=
 Out[19]=
 In[20]:=
 Out[20]=

### Properties and Relations (2)

Rather than use \$Assumptions or DisplayPowersTogether[expr,assum], assumptions can be provided using Assuming:

 In[21]:=
 Out[21]=

Two examples are given here where Simplify can combine a sum of terms:

 In[22]:=
 Out[22]=
 In[23]:=
 Out[23]=

DisplayPowersTogether does not handle sums or differences:

 In[24]:=
 Out[24]=
 In[25]:=
 Out[25]=

### Possible Issues (2)

The result of DisplayPowersTogether has a Head of Defer:

 In[26]:=
 Out[26]=
 In[27]:=
 Out[27]=

It is not a readily-computable expression:

 In[28]:=
 Out[28]=

First can be used to compute on the results:

 In[29]:=
 Out[29]=

Alternatively, copy the output shown previously and evaluate it to perform the computation:

 In[30]:=
 Out[30]=

DisplayPowersTogether can be used again to ensure the square roots are combined again:

 In[31]:=
 Out[31]=

The next example is not in a form that allows DisplayPowersTogether to combine factors:

 In[32]:=
 Out[32]=

When the cube root above is distributed across the sum, DisplayPowersTogether can combine factors:

 In[33]:=
 Out[33]=

Ted Ersek

## Version History

• 1.0.0 – 02 October 2020