Problem with simplification in Mathematica

  • Mathematica
  • Thread starter physics_nil
  • Start date
  • Tags
    Mathematica
In summary, assuming x>0, Sqrt[x^2] //Simplify will simplify to zero if x is positive. However, even if x is positive, if a,b,c>0, then Sqrt[b+c]>0, or Sqrt[a^2+b+c+2 a Sqrt[b+c]]>0, which is not enough to simplify to zero.
  • #1
physics_nil
4
0
Assuming[a>0 && b>0 && c>0, FullSimplify[a+Sqrt[b+c]-Sqrt[a^2+b+c+2 a Sqrt[b+c]]]] does not simplify it to zero. Although output of FullSimplify[a+Sqrt[b+c]-Sqrt[a^2+b+c+2 a Sqrt[b+c]]==0] is true, even without any assumptions. Can anyone please resolve this puzzle...Thanks
 
Physics news on Phys.org
  • #2
The reason it doesn't simplify to zero is that this would throw away one possibility. Basically you are asking it to simplify (x-Sqrt(x^2)). Since Sqrt(x^2) can be either x or -x, (x-Sqrt(x^2)) can be either 0 or 2x. By simplifying this to zero, you are throwing away the second possibility. Mathematica will keep all possibilities unless you explicitly tell it otherwise.
 
  • #3
Your statement is not true as i have specified a>0,b>0,c>0
If you ask mathematica to simplify x-Sqrt[x^2] with assumption x>0, it indeed gives zero!
 
  • #4
I used the simplified example with x to illustrate the problem. In your problem, just because a,b,c>0 doesn't mean that Sqrt[b+c]>0, or that Sqrt[a^2+b+c+2 a Sqrt[b+c]]>0. Even if you tell it that both of these are >0, that still isn't enough. You have to either explicitly tell it to use the positive square root, like this:

FullSimplify[ a + Sqrt[b + c] - Sqrt[a^2 + b + c + 2 a Sqrt[b + c]] /.
Sqrt[a^2 + b + c + 2 a Sqrt[b + c]] -> a + Sqrt[b + c]]

or else square both terms to eliminate the sign ambiguity, like this:

FullSimplify[(a + Sqrt[b + c])^2 - (Sqrt[
a^2 + b + c + 2 a Sqrt[b + c]])^2, {a > 0, b > 0, c > 0}]

It's only a computer program, after all, so it does have its limitations.
 
  • #5
If you're only interested a, b and c being real, then you could use something like:

In[1]:= Reduce[a+Sqrt[b+c]-Sqrt[a^2+b+c+2 a Sqrt[b+c]]==0,{a,b,c},Reals]
Out[1]= (a<=0&&c>=a^2-b)||(a>0&&c>=-b)

In[2]:= Simplify[%,a>0&&b>0&&c>0]
Out[2]= True
 
  • #6
@phyzguy
Then why Assuming[x>0,Sqrt[x^2] //Simplify] is x? I think mathematica only considers positive sqrt.
 
  • #7
@Simon_Tyler
The step comes in a intermediate step of a long program. Unless the answer in simplification is zero, the final answer is too complicated to read. Any suggestion?
 

1. What is the problem with simplification in Mathematica?

The problem with simplification in Mathematica is that it can sometimes oversimplify expressions and equations, leading to incorrect results or loss of important information.

2. How does Mathematica simplify expressions?

Mathematica uses a variety of algorithms and rules to simplify expressions, including factoring, expanding, and combining terms. It also has a built-in Simplify function that attempts to find the simplest form of an expression.

3. Can I control the level of simplification in Mathematica?

Yes, Mathematica allows you to specify the level of simplification you want by using options such as ComplexityFunction and TransformationFunctions. These allow you to customize the simplification process to suit your needs.

4. Are there any alternative methods for simplification in Mathematica?

Yes, there are alternative methods for simplification in Mathematica, such as using the FullSimplify function, which attempts to find the simplest form of an expression while also taking into account assumptions and constraints. You can also use the Simplify function with specific assumptions or use pattern matching and replacement rules to simplify expressions.

5. How can I avoid oversimplification in Mathematica?

To avoid oversimplification in Mathematica, it is important to carefully choose the simplification methods and options you use. You can also double-check your results and use alternative methods of simplification if necessary. Additionally, it is important to have a good understanding of the underlying mathematical concepts to properly interpret and evaluate the simplified expressions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
263
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
416
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
761
Back
Top