MathGroup Archive 2007

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

Search the Archive

Re: Definite Integration in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74683] Re: Definite Integration in Mathematica
  • From: "David W.Cantrell" <DWCantrell at sigmaxi.net>
  • Date: Sat, 31 Mar 2007 01:31:22 -0500 (EST)
  • References: <etqo3f$10i$1@smc.vnet.net> <ett73k$h3g$1@smc.vnet.net> <euigeg$ov1$1@smc.vnet.net>

"dimitris" <dimmechan at yahoo.com> wrote:
> > Back in December, in the thread which led to this one, I gave an
> > antiderivative which is continuous along the whole real line:
> >
> > ArcTan[(4x + Sqrt[2(15 + Sqrt[241])])/(2 - Sqrt[2(-15 + Sqrt[241])])] +
> > ArcTan[(4x - Sqrt[2(15 + Sqrt[241])])/(2 + Sqrt[2(-15 + Sqrt[241])])]
>
> Could we show me how you get this antiderivative for the integrand
>
> f[x_] = (x^2 + 2*x + 4)/(x^4 - 7*x^2 + 2*x + 17);

Let's begin with Mathematica's own antiderivative:
ArcTan[(1 + x)/(4 - x^2)]

Recalling that tan(p + q) = (tan(p) + tan(q))/(1 - tan(p)tan(q)),
let's rewrite (1 + x)/(4 - x^2) in the form
((a*x + b) + (c*x + d))/(1 - (a*x + b)*(c*x + d))
because that will allow us to break apart Mathematica's antiderivative
into a sum of two arctangents having arguments which are _always real_.

In[9]:=
ArcTan[a*x + b] + ArcTan[c*x + d] /. FullSimplify[SolveAlways[
(1 + x)/(4 - x^2) == ((a*x + b) + (c*x + d))/(1 - (a*x + b)*(c*x + d)),
x][[3]]]

Out[9]=
ArcTan[Root[-1 + 15*#1 - 58*#1^2 - 17*#1^3 + 3*#1^4 & , 1] +
x*Root[4 - 8*#1 + 21*#1^2 - 17*#1^3 + 3*#1^4 & , 1]] +
ArcTan[Root[-1 + 15*#1 - 58*#1^2 - 17*#1^3 + 3*#1^4 & , 2] +
x*Root[4 - 8*#1 + 21*#1^2 - 17*#1^3 + 3*#1^4 & , 2]]

Out[9] is equivalent to the continuous antiderivative which I'd given
previously. The process I used to obtain it here could be automated. The
only thing that probably seems mysterious above is why I chose the _third_
solution in particular. Explanation:

SolveAlways returned six solutions. In the first two of those, a and c were
zero, and so those two were not valid. In the last two of those, we got
complex quantities; either of those could in fact have been used, but I
preferred an expression where everything was real. The middle two solutions
involved real quantities only. I could just as well have chosen to use the
fourth solution, instead of the third; doing so would also have produced a
continuous antiderivative equivalent to that which I'd given previously.

David


  • Prev by Date: Re: Integrate (a curious result)
  • Previous by thread: Re: Definite Integration in Mathematica
  • Next by thread: Advice for writing small Scheme interpreter