MATHEMATICA : Forcing Logarithms to Simplify

In summary, the conversation is about forcing the expression A Log[b] + A Log[c] to simplify to A Log[b c], and the challenges that arise when the variables involved are not defined as non-zero positive. The individual is trying to simplify a long integral with multiple logarithms, and while it can be done by hand, Mathematica does not recognize the simplification. The issue may arise from the need to choose the correct options and ensure the variables are defined properly.
  • #1
Hepth
Gold Member
464
40
How can I force :

A Log + A Log[c]

to simplify to A Log[b c]?

I tried, A,b,c all elements of reals, but it doesn't do it. (Assume everything is Real)
I know I can make some patterned rules but I'd rather have it be by default.

(i.e. : a_ Log[b_] + a_ Log[c_] :> a Log[b c])
 
Physics news on Phys.org
  • #2
Simplify[A Log + A Log[c], b > 0 && c > 0]

returns

A Log[b c]
 
  • #3
But what if b and c are not defined as non-zero positive? If b=-2 and c=-3 then shouldn't it come out ok? Or does that, by definition, involve choosing branch cuts.

Basically I'm doing this long integral, and its resulting in multiple logarithms that all end up, if I do it by hand, cancelling. I get something like:

(A) Log[-m1] + (-A) Log[-m2] + (-A) Log[m1*(2 E1-ma)] + (A) Log[m2*(2 E1-ma)

Which if you do by hand, ignoring the fact that m's are positive, you get A Log[1] which is zero. But Mathematica doesn't recognize this. Even the first two should simplify, but I think there's some options I need to choose correctly. I guess I'll start with making sure the m's are all defined as positive, as well as the E's.
 
  • #4
When I Simplify your last expression while telling it that both m1 and m2 are positive or while telling it that both m1 and m2 are negative that is sufficient for it to return zero.

When you do it by hand are you explicitly including that every log of a negative real value includes an infinite set of c*2*i*Pi for a unique integer c each time or are you assuming that c==1 for every one of your Log?
 
  • #5


I understand your frustration with wanting Mathematica to simplify a logarithmic expression in a specific way. Unfortunately, Mathematica is a computer program and it follows specific rules and algorithms in order to simplify expressions. In this case, the program is not able to recognize the pattern you want it to follow by default.

However, there are ways to achieve your desired result. As you mentioned, you can create patterned rules to force Mathematica to simplify in a certain way. Another option is to use the Simplify function with specific assumptions, such as assuming that all variables are real.

For example, you can use the following code to achieve your desired result:

Simplify[A Log + A Log[c], Assumptions -> A ∈ Reals && b ∈ Reals && c ∈ Reals]

This tells Mathematica to simplify the expression assuming that A, b, and c are all real numbers. This should give you the result of A Log[b c].

Overall, while it may be frustrating that Mathematica does not simplify in the way you want it to by default, there are ways to work around this and achieve your desired result. Keep exploring the program and its capabilities, and you may find even more efficient ways to achieve your goals.
 

What is Mathematica?

Mathematica is a software program developed by Wolfram Research that allows users to perform mathematical calculations, create visualizations, and solve complex problems.

Can Mathematica be used to force logarithms to simplify?

Yes, Mathematica has built-in functions and capabilities that allow users to manipulate logarithms and other mathematical expressions to simplify them.

How do I force Mathematica to simplify logarithms?

To force Mathematica to simplify logarithms, you can use the Simplify or FullSimplify functions, along with specific options such as Trig, LogExpand, and LogSimplify. These functions will simplify logarithmic expressions according to predefined rules and assumptions.

What if Mathematica does not simplify my logarithms as desired?

If Mathematica does not simplify your logarithms as desired, you can try using the ExcludedForms option to exclude certain forms from simplification, or you can use the TransformationFunctions option to specify custom simplification rules.

Are there any other useful functions for working with logarithms in Mathematica?

Yes, Mathematica has a wide range of built-in functions for logarithms, including Log, Log10, Log2, and Exp. These functions can be used for calculations and transformations involving logarithmic expressions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
4
Views
736
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Replies
1
Views
878
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Replies
24
Views
2K
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
Back
Top