[Mathematica] Simplify can't handle this trivial example

Click For Summary

Discussion Overview

The discussion revolves around the limitations of Mathematica's Simplify function in handling a specific algebraic expression, particularly in the context of simplifying the expression (b^8 + c^4) / a^8 under the condition a^8 + b^8 + c^4 == 0. Participants explore various approaches to achieve the desired simplification without converting the expression into an equation.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions why Mathematica cannot simplify the expression to -1 directly and seeks a more elegant solution.
  • Another participant points out that the simplification may not hold true for all values, such as when a=0, and suggests using equations for better results.
  • A participant highlights that Mathematica's pattern matching does not recognize certain substitutions, leading to unchanged results when attempting to simplify directly.
  • There is mention of ongoing debates regarding the effectiveness of Mathematica's pattern matching, with some arguing it is correct while others find it inconvenient.
  • One participant proposes creating a function that would allow the expression to be simplified by first converting it into an equation, thus circumventing the limitations of the Simplify function.

Areas of Agreement / Disagreement

Participants express differing views on the capabilities of Mathematica's Simplify function, with no consensus on the best approach to achieve the desired simplification without using equations. Some agree on the limitations of the software, while others propose workarounds.

Contextual Notes

Limitations include the dependency on the specific form of expressions and the behavior of Mathematica's pattern matching, which may not always yield expected results. The discussion also touches on the complexity of using Mathematica effectively.

GargleBlast42
Messages
28
Reaction score
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
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}]
 
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.
 
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.
 
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:

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K