MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Deleting Integrate[] transformation rule (some

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87725] Re: [mg87680] Re: Deleting Integrate[] transformation rule (some
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Wed, 16 Apr 2008 05:03:22 -0400 (EDT)
  • References: <ftq5ab$it$1@smc.vnet.net> <ftscv1$b81$1@smc.vnet.net> <ftv91s$7ur$1@smc.vnet.net> <200804150954.FAA25209@smc.vnet.net>

UHAP023 at alpha1.rhbnc.ac.uk wrote:
> Dear All,
> 	Some progress on my original query.  I tried the following where 
> the formulae below are expressions which integrate to elliptic 
> integrals of the first kind and are from mathematical handbooks.
> 
> Unprotect[Integrate];
> 
> Integrate[1/Sqrt[1 - m_*Sin[phi_]^2], phi_] := 
>   HoldForm[Integrate[1/Sqrt[1 - m*Sin[phi]^2], phi]]
> 
> Integrate[1/Sqrt[(1 - v_^2)*(1 - k_^2*v_^2)], v_] := 
>   HoldForm[Integrate[1/Sqrt[(1 - v^2)*(1 - k^2*v^2)], v]]
> 
> Protect[Integrate];
> 
> 
> Subsequent attempts to integrate (eg. [Integrate[1/Sqrt[1 - a*Sin[b]^2], 
> b]) do indeed leave the integral undone as required.  However more 
> involved expressions such as;
> 
> In[52]:=
> Integrate[Sqrt[Rvt^2 + (4*R^4)/Rx^4], R] // InputForm
> 
> Out[52]//InputForm=
> (R*Sqrt[Rvt^2 + (4*R^4)/Rx^4])/3 - 
>  (I/3*Sqrt[2]*Rvt^2*Sqrt[Rvt^2 + (4*R^4)/Rx^4]*
>    Sqrt[1 - (2*I*R^2)/(Rvt*Rx^2)]*
>    Sqrt[1 + (2*I*R^2)/(Rvt*Rx^2)]*Rx^4*
>    EllipticF[I*ArcSinh[Sqrt[2]*R*Sqrt[I/(Rvt*Rx^2)]], 
>     -1])/(Sqrt[I/(Rvt*Rx^2)]*(4*R^4 + Rvt^2*Rx^4))
> 
> still produce the unwanted EllipticF[].  My question is, is this; (a) 
> because my above HoldForm[] argument expressions are failing to 
> pattern-match the intermediate expressions produced by Integrate[], which 
> it then uses to produce results containing calls to EllipticF[], (b) 
> because Mathematica  knows more expressions than I entered above
> from my handbook which it can integrate up to EllipticF[], or
> (c) something else?
> 
> Any ideas?
> 
> Thanks 
> Tom.
> 
> Ps. The Email address in the header is just a spam-trap.

If you are not averse to using a global flag variable, you can do it as 
follows.

Unprotect[Integrate];

globalIntegrateFlag = True;

Integrate[args__] := Block[
   {globalIntegrateFlag=False, res},
   res = Integrate[args];
   If [FreeQ[res,EllipticF], res, HoldForm[Integrate[args]]]
   ] /; globalIntegrateFlag===True

Examples:

In[7]:= InputForm[Integrate[1/Sqrt[1 - m*Sin[phi]^2], phi]]
Out[7]//InputForm= HoldForm[Integrate[1/Sqrt[1 - m*Sin[phi]^2], phi]]

In[8]:= Integrate[1/Sqrt[1 - phi^2], phi]
Out[8]= ArcSin[phi]

(Even if you are averse to using a global variable, you can still do it 
that way; you'll just be less comfortable with it.)

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Solving equations and inequalities with Reduce - how?
  • Next by Date: Re: Re: A Problem with Simplify
  • Previous by thread: Re: Deleting Integrate[] transformation rule (some progress)
  • Next by thread: Re: transformation rule (some