3
$\begingroup$

I just ran across this:

Assuming[x > 0, Integrate[1/t^2, {t, 1, x}]]

gives the output

ConditionalExpression[(-1 + x)/x, x > 1]

which is clearly too restricted. The correct conditional should be x>0.

The result doesn't evaluate at x=1/2, but

Integrate[ 1/t^2, {t, 1, 1/2} ]

correctly evaluates to -1.

Any thoughts for a workaround?


I'm on OSX with Mathematica 9.0.1.0.

EDIT:

The result cannot be explained by Mathematica having a strong requirement of the upper boundary being strictly greater than the lower boundary of the integral. This can be seen when integrating over functions without singularity or by moving the singularity but not the lower boundary. In this case the conditional is also shifted, despite the unchanged lower boundary.

So there must be some (unintented) interaction between mixed constant and variable boundaries and singularities.

$\endgroup$
13
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Nov 26 '14 at 14:30
  • $\begingroup$ GenerateConditions -> False? $\endgroup$ – Michael E2 Nov 26 '14 at 14:30
  • $\begingroup$ Well, yes, but I'd actually appreciate having correct conditionals :). Thank you for the suggestion! $\endgroup$ – Jazzmaniac Nov 26 '14 at 14:31
  • 1
    $\begingroup$ but when writing Assuming[x > 0, Integrate[1/t^2, {t, 1, x}]], then in here 1 is min, and x is max. According to help. Hence x has to be greater than 1. In the second example, when you wrote Integrate[ 1/t^2, {t, 1, 1/2} ] here you are giving numerical values for the limits, so it knows that the upper limit is less than the lower limit? $\endgroup$ – Nasser Nov 26 '14 at 14:32
  • $\begingroup$ I wasn't sure what sort of workaround you sought, an expression that would evaluate or a precise, correct result. $\endgroup$ – Michael E2 Nov 26 '14 at 14:33
3
$\begingroup$

community wiki, not an answer, just some hints, too small for comment:

Integrate[1/t^2, {t, 1, x}]

Mathematica graphics

May be some smart math person can decode the above. Now:

Assuming[Element[x, Reals], Integrate[1/t^2, {t, 1, x}]]

Mathematica graphics

So the x>1 condition comes out just from say x is real. fyi, This is how Maple does it:

int(1/t^2, t=1..x) ;

It does not even integrate this, it says:

Mathematica graphics

However,

 int(1/t^2, t=1..x) assuming x>0 ;

gives same as Mathematica:

Mathematica graphics

But Maple does not generate answers with conditionals like Mathematica. User must give the conditions. So the above is for x>0. But using AllSolutions will make it generate this

 int(1/t^2, t=1..x,AllSolutions )  ;

Mathematica graphics

The above seems to be the answer the OP is expecting to get from Mathematica.

$\endgroup$
2
$\begingroup$

First, Integrate normally takes the assumptions as given and only adds conditions that are needed beyond the assumptions specified. Thus I would expected the integral

Assuming[x > 0, Integrate[1/t^2, {t, 1, x}]]

to result in

1 - 1/x

instead of a ConditionalExpression, since the assumption x > 0 is sufficient to guarantee the result is valid.

The integral by itself produces a (somewhat) correct result:

int = Integrate[1/t^2, {t, 1, x}]
(*
ConditionalExpression[
 1 - 1/x, ((Re[1/(-1 + x)] >= 0 || 
      Re[1/(-1 + x)] <= -1) && (x ∉ Reals || 
      Re[1/(-1 + x)] < -1 || Re[x] >= 1)) || 
  1/(-1 + x) ∉ Reals]
*)

It evaluates correctly but in two cases produces messages at x -> 0 and x -> 1:

Table[int, {x, {-1, 1/2, 2}}]
(*
  {Undefined, -1, 1/2}
*)

int /. x -> 0
(* Power::infy: Infinite expression 1/0 encountered. >> *)
(*
  Undefined
*)

int /. x -> 1
(* Power::infy: Infinite expression 1/0 encountered. >> (several) *)
(*
  0
*)

But there's something funny going at with x -> 1. The condition 1/(-1 + x) ∉ Reals evaluates to True for x -> 1, and therefore the integral expression is valid. But some functions take the expression 1/(-1 + x) in the condition to impose a restriction on x, that x ≠ 1. For instance

MapAt[
 Reduce[# && x > 0] &,
 Integrate[1/t^2, {t, 1, x}],
 2]
(*
  ConditionalExpression[1 - 1/x, 0 < x < 1 || x > 1]
*)

This may have something to do with the result of the OP's integral.

Finally, another way to get a correct result is to give the integral a good whack and knock it off the real line:

Assuming[x > 0, Integrate[1/t^2, {t, 1, I, x}]]
(*
  1 - 1/x
*)
$\endgroup$
1
$\begingroup$

Please consider this just as a comment. It seems you should explicitly say to integrate that you want work with 'say' inversed boundaries, because only then it understands it:

Integrate[1/t^2, {t, 1, x}, Assumptions -> x < 1]

ConditionalExpression[(-1 + x)/x, x > 0]

I suppose it rather some kind of reticence. As a workaround I could suggest one can work this way:

x1 = 1;
xlowlimit = 0;

fun[t_] := -1/t^2;

If[x1 < xlowlimit ,
  Assuming[x > x1reg, Integrate[fun[t], {t, x1, x}]],
 {ConditionalExpression[
    Assuming[xlowlimit < x < x1, Integrate[fun[t], {t, x1, x}]], x1reg < x < x1],
  Assuming[xlowlimit < x, Integrate[fun[t], {t, x1, x}]]}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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