Complex elimination and possible Integrate[] bug -- advice sought
- To: mathgroup at smc.vnet.net
- Subject: [mg84542] Complex elimination and possible Integrate[] bug -- advice sought
- From: UHAP023 at alpha1.rhbnc.ac.uk
- Date: Thu, 3 Jan 2008 05:35:21 -0500 (EST)
- Organization: Low Temperature Physics, RHUL
Dear All, A couple of queries; (1) Regarding the following expression, z=2*Sqrt[2]*Rvt^5*(Rvt^2 + Rx^2)^(3/2)*w^2* (Sqrt[2*Dc - I*Rx^2*w]*(2*Dc - I*(Rvt^2 + Rx^2)*w)^3 + Sqrt[2*Dc + I*Rx^2*w]*(2*Dc + I*(Rvt^2 + Rx^2)*w)^3) all the variables are of Real type and are +ve. I do the following FullSimplify[], z = FullSimplify[ z, {Rx \[Element] Reals, Rvt \[Element] Reals, Dc \[Element] Reals, w \[Element] Reals, Rx > 0, Rvt > 0, Dc > 0, w > 0}] and get an unchanged result. Now I believe that this expression should *always* produce a real result for real, +ve parameter values. A simple but obviously non-rigorous test is to substitute arbitrary real,+ve values for the parameters and observe the numeric result, eg., Rx = Random[]; Rvt = Random[]; w = Random[]; Dc = Random[]; z The result is indeed always real (ie. Im[z]==0). Given that FullSimplify[] tries to return the simplest result rather than eliminate complex expressions as I want, I tried doing, FullSimplify[z, {Rx \[Element] Reals, Rvt \[Element] Reals, Dc \[Element] Reals, w \[Element] Reals, Rx > 0, Rvt > 0, Dc > 0, w > 0}, ComplexityFunction -> (Count[{#1}, _Complex , \[Infinity]] &)] which I hoped would do what I want. Unfortunately it returns a more complicated result (fair enough) but which has the same number of I's as the input expression (not OK). What am I doing wrong here? Is there a way to do this? ============================================================================= (2) The above query was precipitated indirectly by the following strangeness. I am integrating the following integrand, igrand=(Dc*Rx^2*Cos[theta]^2)/((4*Dc^2 + Rx^4*w^2*Cos[theta]^4)* (Rvt^2 + Rx^2*Sin[theta]^2)^3) Again the parameters are all of Real type and +ve. Moreover the expression only contains a fraction, sums and products. The integral below is definite and both Cos[] and Sin[] are +ve over the integration limits, so the area under the graph should also be Real and +ve. igral = Integrate[igrand, {theta, 0, Pi/2}, Assumptions -> {Rx \[Element] Reals, Rvt \[Element] Reals, w \[Element] Reals, Dc \[Element] Reals, theta \[Element] Reals, Rx > 0, Rvt > 0, w > 0, Dc > 0, theta >= 0}] However the integral contains many complex terms which is understandable AIUI because Integrate[] tries many transforms/pattern matches to do the integration -- some of which will produce a complex result. The thing that puzzles me is that the integration result contains lots of terms such as 'Sign[Rvt]^2'. My point is that Integrate[] has been explicitly told in its Assumptions argument that Rvt in this case is Real and +ve, so why does it do this? Is this a bug? Admittedly a, Simplify[igral, {Rx \[Element] Reals, Rvt \[Element] Reals, w \[Element] Reals, Dc \[Element] Reals, Rx > 0, Rvt > 0, w > 0, Dc > 0}] will remove terms like 'Sign[Rvt]^2' but I still end up with a complex and unwieldy expression which is much larger that the integrand. Any suggestions? Many thanks Tom Crane Ps. I'm using Mathematica 4.0 and the From: field in the message header is invalid. It is just a spam-trap. -- Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill, Egham, Surrey, TW20 0EX, England. Email: T.Crane at rhul dot ac dot uk Fax: +44 (0) 1784 472794
- Follow-Ups:
- Re: bug --
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: bug -- advice sought
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: bug --