Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Here is an integral I've been studying in my research and I've just realized that Mathematica $8.0$ is unable to correctly compute it. I have 2 simple questions to ask:

$1)$. Is my code below correct?

              Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), {x, 0, 1}]

$2)$. Are the newer Mathematica versions able to correctly compute it (how about W|A)?

Please do not provide with mathematical solutions, I like to attend this part on my own.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Your syntax is correct and v.9 produces a result. If appropriate you can halp things by adding assumptions..for example:

     Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), {x, 0, 1}, 
          Assumptions -> {a > 0, b > 0, c > 0}]

-PolyGamma[0, a] + PolyGamma[0, b/c]

Indeed.. it apperars to be incorrect..

 example = {a -> RandomReal[{0, 2}], b -> RandomReal[{0, 2}], c -> RandomReal[{0, 2}]}
 Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), {x, 0, 1}, 
        Assumptions -> {a > 0, b > 0, c > 0}] /. example
 Integrate[
     x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c) /. example, {x, 0, 1} ]
 NIntegrate[
     x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c) /. example, {x, 0, 1} ]

{a -> 1.35623, b -> 1.98544, c -> 0.957961}

0.57579

0.532842

0.532842

Edit.. try the indefinite integral :

   indef = Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), x, 
         Assumptions -> {a > 0, b > 0, c > 0}]

   Simplify[ Limit[ indef , x -> 1 ] - indef /. x -> 0 , 
       Assumptions -> {a > 0, b > 0, c > 0} ]

1/a + Log[c] - PolyGamma[0, 1 + a] + PolyGamma[0, b/c]

Is that right?? Gives the same numerical result for the example

 % /. example // N

0.532842

share|improve this answer
    
This is a wrong answer, but thanks for your effort. (+1) –  Chris's sis Feb 12 at 19:10
    
It seems OK, excepting the fact it's not nicely simplified (the answer I mean). –  Chris's sis Feb 12 at 19:59
    
FullSimplify .. gets got there.. same as chuy's answer –  george2079 Feb 12 at 21:26
add comment

Problem looks to occur when doing the definite integral. If you start with the indefinite integral:

int = Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), x]

(* x^a/a + (x^(1 + a) Hypergeometric2F1[1, 1 + a, 2 + a, x])/(1 + a) - 
   (c x^b Hypergeometric2F1[1, b/c, 1 + b/c, x^c])/b *)

and you do the limits by hand you get:

result=FullSimplify[Limit[int,x-> 1, Assumptions->{a>0,b>0,c>0}]-Limit[int,x-> 0, Assumptions->{a>0,b>0,c>0}]]

(* 1/a + EulerGamma - HarmonicNumber[a] + Log[c] + PolyGamma[0, b/c] *)

which looks correct.

example = {a -> RandomReal[{0, 2}], b -> RandomReal[{0, 2}], c -> RandomReal[{0, 2}]}

(* {a -> 1.90438, b -> 0.334205, c -> 0.32148} *)

result /. example

(* -2.00794 *)

and

NIntegrate[x^(a-1)/(1-x)-c x^(b-1)/(1-x^c)/.example,{x,0,1}]

(* -2.00794 *)
share|improve this answer
    
OK, thanks for feedback! (+1) –  Chris's sis Feb 12 at 20:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.