Re: Simplifying the root of a quadratic
- To: mathgroup at smc.vnet.net
- Subject: [mg63910] Re: [mg63906] Simplifying the root of a quadratic
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sat, 21 Jan 2006 05:05:41 -0500 (EST)
- References: <200601210650.BAA11332@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 21 Jan 2006, at 07:50, carlos at colorado.edu wrote: > Consider > > etaC=(-48*A0^2-4*A1^2+4*A2^2+ > Sqrt[768*A0^2*A2^2+(48*A0^2+4*A1^2-4*A2^2)^2])/(96*A0*A2); > > Neither Simplify nor FullSimplify (with or without assumptions > on the A's) were able to produce the simpler form > > etaC=(-12*A0^2-A1^2+A2^2+ > Sqrt[48*A0^2*A2^2+(12*A0^2+A1^2-A2^2)^2])/(24*A0*A2); > > which I had to do finally by hand. > > Why? > As usual there seem to be two problems involved here: the problem of the ComplexityFunction and of the transfomrations used. Using my compleity function based on the number of visible characters one can get a better simplification: VisibleSimplify[expr_, opts___] := Simplify[ expr, opts, ComplexityFunction -> (StringLength[ToString[TraditionalForm[#]]] &)] VisibleSimplify[etaC] (-12*A0^2 - A1^2 + A2^2 + Sqrt[144*A0^4 + 24*(A1^2 + A2^2)*A0^2 + (A1^2 - A2^2)^2])/(24*A0*A2) This is better than what Simplify or FullSimplify gives but still not as simple as your expression. It differs from it only in the part under the square root sign. What you have is exp1 = 48*A0^2*A2^2 + (12*A0^2 + A1^2 - A2^2)^2; and what VisibleSimplify produces is exp2 = 144*A0^4 + 24*(A1^2 + A2^2)*A0^2 + (A1^2 - A2^2)^2; Of course Mathematica can confirm that they are equal: Simplify[exp1==exp2] True However, not also that both these expressions are in a sense "optimal" for Simplify or VisibleSimplify, in that they won't be changed to anything else (even by FullSimplify or VisibleFullSimplify defined analogously to the above): FullSimplify[exp1] 48*A0^2*A2^2 + (12*A0^2 + A1^2 - A2^2)^2 FullSimplify[exp2] 144*A0^4 + 24*(A1^2 + A2^2)*A0^2 + (A1^2 - A2^2)^2 I think you cna compare the situation to what happens when you use FindMinimum when you want to find the global minimum of some function. In such cases FindMinimum may find a local minimum that is not a global minimum. Like in the case of a local minimum, given one of the expressions above (exp1) or exp2, Simplify can't find any "local" transformations that would lead to a simpler expression. I think you can see why when you look at the expanded form of the expression: Expand[exp1] 144*A0^4 + 24*A1^2*A0^2 + 24*A2^2*A0^2 + A1^4 + A2^4 - 2*A1^2*A2^2 Now you can see that it contians the term 24*A2^2*A0^2 but in your expression you have 48*A0^2*A2^2. So in fact to have a chance of "seeing" this simpler expression Simplify woudl have to add 24*A2^2*A0^2 to exp3 (and subtract it again) but that is the kind of transformation it never attampts ( for obvious reasons - because there are infinitely many transformations of this kind that could be tried). However, note that Simplify[exp2 - 48*A0^2*A2^2] + 48 A0^2*A2^2 48 A0^2*A2^2 + (12*A0^2 + A1^2 - A2^2)^2 which is exactly exp1. I think this is an example where human intelligence displays its superiority and I don't think one can avoid this kind of situations without some much more advanced form of AI, which I do not think still exists (?). Andrzej KOzlowski
- References:
- Simplifying the root of a quadratic
- From: carlos@colorado.edu
- Simplifying the root of a quadratic