0
$\begingroup$

I need to integrate the expression (t^(1/3)-t^(2/3)) from t=-1 to t=0, using Mathematica version 7, and I want the real answer only. How do I do this? I am not sure whether I use NIntegrate or if it must be done with Integrate and somehow later evaluate it. Obviously I want whichever should be used restricted to Reals only. I’ve looked at Assumptions, Assuming, Element, and many other things, but I am totally a beginner, and I can’t get anything to work. I have spent many hours trying to do this. Would you give me the code to do it? (Please assume I know little to nothing.)

Copyable code:

NIntegrate[t^(1/3)-t^(2/3), {t,-1,0}]
$\endgroup$
4
  • 3
    $\begingroup$ Have you seen Surd ? $\endgroup$
    – LouisB
    Nov 10 '21 at 4:52
  • $\begingroup$ It appears you want Integrate[Surd[t, 3] - Surd[t^2, 3], {t, -1, 0}]. $\endgroup$
    – bbgodfrey
    Nov 10 '21 at 5:27
  • $\begingroup$ Note that Surd was introduced in V9. The OP is specifically asking about V7. $\endgroup$
    – Michael E2
    Nov 10 '21 at 13:49
  • $\begingroup$ Here's a way to rewrite an integrand to use real powers, with the tacit assumption that the base of Power is always real: newintegrand = integrand /. Power[b_, x_Rational] /; OddQ@Denominator@x :> Simplify[Sign[b]^Numerator[x], b \[Element] Reals && b != 0] Power[Abs[b], x] $\endgroup$
    – Michael E2
    Nov 10 '21 at 13:57
3
$\begingroup$
Clear["Global`*"]

$Version

(* "12.3.1 for Mac OS X x86 (64-bit) (June 19, 2021)" *)

Surd was introduced in v9.

int = Integrate[Surd[t, 3] - Surd[t^2, 3], {t, -1, 0}]

(* -(27/20) *)

int // N

(* -1.35 *)

For earlier versions,

surd[x_, n_Integer?OddQ] := Sign[x]*Abs[x]^(1/n)

surd[x_?Positive, n_Integer?EvenQ] := x^(1/n)

int2 = Integrate[surd[t, 3] - surd[t^2, 3], {t, -1, 0}]

(* -(27/20) *)

Plot[surd[t, 3] - surd[t^2, 3], {t, -1, 0},
 Filling -> Axis]

enter image description here

$\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.