Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Contracts sums of logarithms into a single logarithm
Reproduce a basic Log identity:
In[1]:= |
Out[1]= |
Find conditions for which Log[a]-Log[b] is equal to Log[a/b]:
In[2]:= |
Out[2]= |
Contract logs, disregarding branch cut issues:
In[3]:= |
Out[3]= |
The result is not generically true:
In[4]:= |
Out[4]= |
LogContract automatically threads over equations:
In[5]:= |
Out[5]= |
LogContract is essentially the inverse of PowerExpand for logarithmic expressions:
In[6]:= |
Out[6]= |
Contracting to the original expression:
In[7]:= |
Out[7]= |
The default option setting for Assumptions is $Assumptions. By default $Assumptions=True, meaning that LogContract gives a universally correct result:
In[8]:= |
Out[8]= |
With the setting Automatic, a maximal set of assumptions are used and the output is not generically correct:
In[9]:= |
Out[9]= |
A simpler result is obtained with suitable assumptions:
In[10]:= |
Out[10]= |
Contract logs assuming real arguments:
In[11]:= |
Out[11]= |
In[12]:= |
Out[12]= |
In[13]:= |
Out[13]= |
The default option for LogContract is Assumptions→True, unlike PowerExpand which uses Automatic as the default:
In[14]:= |
Out[14]= |
In[15]:= |
Out[15]= |
This work is licensed under a Creative Commons Attribution 4.0 International License