How to simplify an expression in Mathematica

Click For Summary

Discussion Overview

The discussion revolves around the challenges of simplifying mathematical expressions using Mathematica, particularly focusing on the commands Simplify and FullSimplify. Participants share their experiences with specific expressions and the results obtained, exploring the nuances of simplification in Mathematica.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents an expression, Sqrt[a^2*(Cosh(x))^2*(Sin(y))^2], and notes that Simplify[] does not yield a simpler form.
  • Another participant suggests using FullSimplify, highlighting its more aggressive techniques compared to Simplify.
  • A participant mentions that FullSimplify also fails to simplify the initial expression, returning it unchanged.
  • Some participants express skepticism about Mathematica's simplification capabilities, suggesting that different simplifications may depend on the desired outcome.
  • Concerns are raised about the handling of square roots, specifically that Sqrt[a^2] does not simplify to a without additional conditions.
  • Discussion includes the importance of specifying assumptions in Mathematica to achieve desired simplifications, particularly for expressions involving parameters like a, B, and P.
  • Participants explore the potential for different simplification results when using related functions like TrigExpand and ExpToTrig.
  • One participant shares their experience with calculating Lame's coefficients and the discrepancies between their manual results and those obtained from Mathematica.
  • Another participant suggests that assumptions about the variables can lead to more reasonable simplifications in Mathematica.

Areas of Agreement / Disagreement

Participants generally agree that Mathematica's simplification commands do not always yield expected results, and there is no consensus on the effectiveness of these commands for all types of expressions. Multiple competing views on the best approach to simplification remain present.

Contextual Notes

Limitations include the need for specific assumptions to achieve certain simplifications, as well as the potential for different simplification outcomes based on the functions used and the expressions involved.

niko2000
Messages
50
Reaction score
0
Hi,
I have got this expression from Mathematica:
Sqrt[a^2*(Cosh(x))^2*(Sin(y))^2]
I have tried to simplify this expression with Simplify[], but it returns the same result.
I have tried to solve some other expressions and it returned some strange forms.
For example:
I have tried to solve some equation on paper and I've got this:
a*Sqrt[(Cos(x))^2+(Sinh(y))^2]
Then I have tried to solve the same equation with Mathematica and it has returned some long expression containing combinations of double angles.
Does anyone know what to do to get the simplest expression?
Anyway I don't know why Mathematica couldn't simplify an expression as simple as a*Sqrt[(Cos(x))^2+(Sinh(y))^2]
 
Physics news on Phys.org
Have you tried FullSimplify?

If you read the documentation, you'll see FullSimplify does quite a bit more. It has more aggressive factoring, rationalizing, and other techniques that Simplify does not.
 
On Sqrt[a^2*(Cosh(x))^2*(Sin(y))^2] FullSimplify doesn't work. It returns the same expression.
 
Nothing's perfect. :smile:
 
I also found that Mathematica Simplify command doesn't work as we expect.
Your expression looks already simplified...one can make different simplifications according to the expression we want to reach, mathematica also gives one possibility.If your expression contains only terms, which doesn't contain any Sin or Cos or some other functions, Mathematica is okay...Mathematica 5.0 has more advanced features..have a look at it..
 
manesh said:
I also found that Mathematica Simplify command doesn't work as we expect.
Your expression looks already simplified...one can make different simplifications according to the expression we want to reach, mathematica also gives one possibility.If your expression contains only terms, which doesn't contain any Sin or Cos or some other functions, Mathematica is okay...Mathematica 5.0 has more advanced features..have a look at it..

That's why I always try FullSimplify.

If you read the release notes, you'll see that 99% of the modifications from 4.0 to 5.0 deal with performance enhancements (specifically linear algebra functions). I've been unable to find any enhancements to FullSimplify and Simplify other than performance.
 
exactly u r right..
 
Remember:

<br /> \[<br /> \sqrt {a^2 } \ne a<br /> \]<br />

And it won't do this invalid operation.

Best
 
What is true if that's not true?
 
  • #10
<br /> \[<br /> \sqrt {a^2 } = \pm a<br /> \]<br />​
If you want to ignore the negative root you have to explicitly indicate this.
Simplify[Sqrt[a^2]] just yields √a2
but
Simplify[Sqrt[a^2], a>=0] simplifies to a
Why are you expecting
a*Sqrt[(Cos[x])^2 + (Sinh[y])^2]

to simplify?

Just to make sure the obvious is covered: you have noticed that Sinh is shown rather than Sin? And also that Cos is applied to x while Sinh is applied to y?

Have you checked out the hints in the online documentation on getting Simplify to do what you want? Have you looked at related functions like TrigExpand and ExpToTrig?
 
  • #11
a*Sqrt[(Cos[x])^2+(Sinh[y])^2] is what I've got on paper and that is not related to the first problem.
The first problem was that mathematica couldn't simplify this:
Sqrt[a^2*(Cosh(x))^2*(Sin(y))^2]
 
  • #12
plover said:
<br /> \[<br /> \sqrt {a^2 } = \pm a<br /> \]<br />​
If you want to ignore the negative root you have to explicitly indicate this.
Simplify[Sqrt[a^2]] just yields √a2
but
Simplify[Sqrt[a^2], a>=0] simplifies to a
Why are you expecting
a*Sqrt[(Cos[x])^2 + (Sinh[y])^2]

to simplify?

Just to make sure the obvious is covered: you have noticed that Sinh is shown rather than Sin? And also that Cos is applied to x while Sinh is applied to y?

Have you checked out the hints in the online documentation on getting Simplify to do what you want? Have you looked at related functions like TrigExpand and ExpToTrig?


I was under the impression that FullSimplify calls TrigExpand and ExpToTrig for a maximum simplification effect.
 
  • #13
graphic7 said:
I was under the impression that FullSimplify calls TrigExpand and ExpToTrig for a maximum simplification effect.
I'm no expert, I was just offering suggestions of things to look at. However, when used on the expression:
a*Sqrt[(Cos[x])^2 + (Sinh[y])^2]

both Simplify[] and FullSimplify[] alone do nothing, while Simplify[TrigToExp[]], ExpToTrig[Simplify[TrigToExp[]]], and FullSimplify[TrigToExp[]] all produce different answers (though the last two are similar). I'm using version 4.1.
 
  • #14
niko2000 said:
a*Sqrt[(Cos[x])^2+(Sinh[y])^2] is what I've got on paper and that is not related to the first problem.
Yes, I understand this. But you also said:
Anyway I don't know why Mathematica couldn't simplify an expression as simple as a*Sqrt[(Cos(x))^2+(Sinh(y))^2]
It seems you think this expression should simplify, and that the reason it should simplify is obvious. Since I don't see any good way to simplify this and neither does Mathematica, I'm wondering why you think it simplifies, and what you would simplify it to.

At the moment, I see two possibilities, either a) your expectation is incorrect, or b) I am not understanding your expectation.
The first problem was that mathematica couldn't simplify this:
Sqrt[a^2*(Cosh(x))^2*(Sin(y))^2]
Again, I'm not sure why you think this should simplify. What form did you want it to be in? There are many functions for transforming expressions in Mathematica other thanSimplify[].
 
  • #15
We were calculating Lame's coeficients for some coordinate system.
We had these data:
x=a*Cosh*Sin[P]*Cos[F]
y=a*Cosh*Sin[P]*Sin[F]
z=a*Sinh*Cos[P]

The first coeficient (let's call it f1):
f1=Sqrt[(dx/dB)^2+(dy/dB)^2+(dz/dB)^2]
The second:
f2=Sqrt[(dx/dP)^2+(dy/dP)^2+(dz/dP)^2]
The third:
Sqrt[(dx/dF)^2+(dy/dF)^2+(dz/dF)^2]

After our calculations we've got this:
f1=f2=a*Sqrt[Cos[P]^2+sinh^2]
f2=a*Cosh*Sin[P]

When I tried to get these results with Mathematica I have got much more complex results.
Instead of giving the results in the same form it gave for f1 and f2 some combination of double angles and f3 Sqrt[a^2*(Cosh(x))^2*(Sin(y))^2]
 
  • #16
For f3 you need to give assumptions in order to simplify. Do you have constraints for the values of a, B, and P?

The most obvious assumption to provide is that a, B, and P are real numbers.
Simplify[f3, Element[{a,B,P},Reals]]
yields
Abs[a] Abs[Sin[P]] Cosh
This seems reasonable.

If you can also say that a>=0 and 0<=P<=Pi then you can simplify to the form you gave:
Simplify[f3, Element[{a,B,P},Reals] && (a>=0) && (0<=P<=Pi)]
yields
a Sin[P] Cosh

Unfortunately, I can't see any easy way to get Mathematica to simplify to the form you give for f1 and f2 rather than the double angle form. I'm not enough of an expert to be sure that none actually exists though. But, this may just be one of those things for which the human brain is still the best tool.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K