(%i2) f( x) : = x ^ 3 - x ^ 2 + 2 x + 1 $
wxdraw2d( filled_func = 0, fill_color = grey, explicit( f( x), x, - 2, 2),
filled_func =false, color = blue, line_width = 3, explicit( f( x), x, - 2, 2),
xaxis =true, yaxis =true) ;
(%t2)  (Gráficos)
(%o2)

Como vimos el pasado día la función tiene un cero:

(%i4) realroots( f( x) = 0, 10 * * - 2), numer ;
p : ev( x, %) $
(%o3) [ x = 0.39453125 ]

Ahora solo tendremos que integrar: \(\int_{-2}^{2}f(x)\,dx=-\int_{-2}^{p}f(x)\,dx+\int_{p}^{2}f(x)\,dx\)

(%i5) integrate( f( x), x, p, - 2) + integrate( f( x), x, p, 2), numer ;
(%o5) 16.42469797706386

Observar que no es correcto:

(%i6) integrate( f( x), x, - 2, 2) ;
(%o6) 4 3

Created with wxMaxima.