1
$\begingroup$

This is the integrand:

1/beta/(2*z)/(1 - beta) // TraditionalForm

Integrating with respect to z, gives

Integrate[1/beta/(2*z)/(1 - beta), z]

-(Log[-2 (-1 + beta) beta z]/(2 (-1 + beta) beta))

What I hope to get is from doing so:

1/beta/2/(1 - beta)*Integrate[1/z, z]

Log[z]/(2 (1 - beta) beta)

But if I look at the two answers, they are not equivalent, eg the difference does not simplify to 0.

Should I make some assumptions in the first case? Or Am I doing something wrong?

Update:

ans1 = Integrate[1/beta/(2*z)/(1 - beta), z]
ans2 = 1/beta/2/(1 - beta)*Integrate[1/z, z]
tmp = ans1 - ans2 // FullSimplify

I was thinking that tmp should be zero, but I was wrong. It is a constant, which is free of z.

So both answers are correct.

But could I get the desired answer in the first place anyway?

$\endgroup$
6
  • 2
    $\begingroup$ They're the same up to a constant offset. (Remember: Log[ab] = Log[a] + Log[b] for real positive numbers, and the indefinite is unique only up to a constant.) $\endgroup$
    – march
    Commented Aug 2, 2015 at 14:47
  • $\begingroup$ @march Yes, I see what you meant!! But just for the sake of this question, could I get the desired answer? $\endgroup$ Commented Aug 2, 2015 at 14:54
  • $\begingroup$ Maybe if you tried to Simplify Assuming that z is positive and that beta is between 0 and 1? The problem is that MMA assumes numbers are complex by default. So I don't know. $\endgroup$
    – march
    Commented Aug 2, 2015 at 15:02
  • 1
    $\begingroup$ Closely related: Order of integration changes output of indefinite multiple integral in Mathematica 7 $\endgroup$
    – Jens
    Commented Aug 2, 2015 at 21:59
  • $\begingroup$ @Jens Thanks. I will take a look. $\endgroup$ Commented Aug 2, 2015 at 22:14

2 Answers 2

4
$\begingroup$

The brute force method to arrive at your second solution

f[z_] = 1/beta/(2*z)/(1 - beta);

cl = CoefficientList[f[z], 1/z];

cl.Integrate[(1/z)^Range[0, Length[cl] - 1], z]

Log[z]/(2*(1 - beta)*beta)

$\endgroup$
2
$\begingroup$

You could use a definite integral:

Integrate[1/beta/(2*z0)/(1 - beta), {z0, 1, z}, Assumptions -> {z > 1, 0 < beta < 1}]
(* Log[z]/(2 beta - 2 beta^2) *)

Of course, this requires by-hand tuning of the lower limit, but if you want a certain form (i.e. a certain choice of offset), then that's required anyway.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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