Mathematica Commands for Integration

In Mathematica, if you type,

f[x_]:= x^3 + 2*Sin[x] - 5*x^2 + 2;

then f(x) is defined to be the expression (x^3)-5 (x^2)+2 sin(x)+2.  You can find an antiderivative F(x) for f(x) with the following command:

F:= Integrate[f[x], x]

Then F(x)=((x^4)/4)-((5 (x^3))/3)+2 x-2 cos(x).  Notice that Mathematica chooses the constant (+C) to be zero.  You can also compute definite integrals using the Integrate command, in the following way:

Integrate[f[x], {x, 0, Pi}]

This is the integral of f(x) from 0 to π, which has value 4+2 π-((5 (π^3))/3)+((π^4)/4).  If you have computed the exact value with the Integrate command, and you want an approximate value, use the N command:

N[%]

In Mathematica, the % stands for the output of the previous computation.