# How to get the numerical answer to NIntegrate[t^(1/3)-t^(2/3),{t,-1,0}] in Reals only

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}]

• Have you seen Surd ? Nov 10, 2021 at 4:52
• It appears you want Integrate[Surd[t, 3] - Surd[t^2, 3], {t, -1, 0}]. Nov 10, 2021 at 5:27
• Note that Surd was introduced in V9. The OP is specifically asking about V7. Nov 10, 2021 at 13:49
• 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] Nov 10, 2021 at 13:57

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]
`