[Mathematica] Simplify can't handle this trivial example

In summary: You can do it.In summary, the conversation discusses the use of Mathematica (8.0) to simplify an expression (b^8 + c^4)/a^8 without putting it into an equation. It is suggested to use the Reduce or Simplify functions, but it is noted that the pattern matcher may not always work as expected. The solution proposed is to write a custom function that takes the expression and converts it into an equation before passing it to Simplify.
  • #1
GargleBlast42
28
0
Hi everyone,

I'm wondering why Mathematica (8.0) can't bring this to the obvious form -1, and leaves the expression as is:
Code:
Simplify[(b^8 + c^4) /a^8, a^8 + b^8 + c^4 == 0]
Is there any nice and elegant way how to achieve that?

(I know, that I could take e.g. /.c->(-a^8-b^8)^(1/4), but I'd like Mathematica to do it just by using the equation).
 
Physics news on Phys.org
  • #2
The obvious form is not always correct, for example, when a=0. Also, simplify works better with equations than with expressions. You can get it to work using

Simplify[(b^8 + c^4)/a^8 == k, {a^8 + b^8 + c^4 == 0, a^8 != 0}]

or if you want to allow for the case that a=0

Reduce[{(b^8 + c^4)/a^8 == k, a^8 + b^8 + c^4 == 0}]
 
  • #3
Thanks, your solution works, but it still has a problem - it only seems working when I take the expression in an equation. But I want to simplify solely the expression (b^8 + c^4)/a^8 without putting it into an equation.
 
  • #4
It seems like what you would like to have happen is for Mathematica to automatically recognize that it should replace a^8 by -(b^8+c^4). So I try this:

(b^8+c^4)/a^8 /. a^8 -> -(b^8+c^4)

and it just returns (b^8 + c^4)/a^8 unchanged. What went wrong?

FullForm[(b^8 + c^4)/a^8] shows Times[Power[a, -8], Plus[Power[b, 8], Power[c, 4]]]
and Power[a,8] is not going to match Power[a,-8] so the pattern matcher finds no matches, replaces nothing and returns the original.

Manually this can be fixed, try substituting for a^-8 by taking reciprocals.

(b^8+c^4)/a^8 /. a^-8 -> -1/(b^8+c^4)

returns -1 as I think you wish.

There have been raging arguments for a couple of decades over whether the pattern matching in Mathematica is just fine and perfectly correct the way it is or whether it is sometimes wrong or inconvenient and could or should be changed. Feel free to search the archives of comp.soft-sys.math.mathematica for decades of postings, some of which include the arguments and most puzzling examples of such behavior. But it appears that none of those arguments have ever resulted in a single change in the pattern matcher.

Unfortunately there is no DoWhatIMean button that when clicked will do what is "obviously mathematically correct" in every case and give you the answer you want. Mathematica, like almost all complex software tools, and certainly all computer algebra tools, probably requires thousands of hours of intense study to gain real proficiency.
 
  • #5
GargleBlast42 said:
Thanks, your solution works, but it still has a problem - it only seems working when I take the expression in an equation. But I want to simplify solely the expression (b^8 + c^4)/a^8 without putting it into an equation.
So then you will need to write a function which takes the expression without the equation as an argument, puts it into an equation, passes it to Simplify, and then casts the result as an expression, and returns that expression. Writing that type of interface function is a pretty common activity in any programming language.
 
Last edited:

What is Mathematica Simplify?

Mathematica Simplify is a function in the Mathematica software that attempts to simplify mathematical expressions by applying various transformation rules.

Why can't Mathematica Simplify handle a trivial example?

There are several reasons why Mathematica Simplify may struggle to handle a trivial example. One possibility is that the expression is already in its simplest form. Another possibility is that the expression is too complex for Simplify to handle. Additionally, there may be specific transformation rules that need to be applied for Simplify to work, and these rules may not be applicable to the trivial example.

Can I adjust settings to make Mathematica Simplify work on a trivial example?

Yes, there are several options for adjusting settings in Mathematica Simplify to potentially make it work on a trivial example. These include adjusting the complexity threshold, increasing the number of transformation rules, or specifying specific transformation rules to be applied.

Are there alternative functions in Mathematica that can handle a trivial example?

Yes, there are alternative functions in Mathematica that may be better suited for simplifying a trivial example. These include FullSimplify, which applies more transformation rules, and Simplify[expr, TransformationFunctions -> {Automatic}] which allows for custom transformation rules to be specified.

Is it worth troubleshooting Mathematica Simplify for a trivial example?

It depends on the specific situation. If the trivial example is not important to the overall analysis, it may be more efficient to manually simplify the expression. However, if the trivial example is part of a larger and more complex expression, it may be worth troubleshooting Mathematica Simplify to see if it can be simplified automatically.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
22
Views
3K
  • Science and Math Textbooks
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
4K
  • Mechanical Engineering
Replies
2
Views
197
Back
Top