Feeds:
Posts

## SAGE tip: Graphs of Elementary Numerical Integrals

Looking on the notebook worksheets publish on sagenb I found a very interesting application of the interactive mode, Interactive.

Since one can not look the result of the published notebooks, I use its code to playing around a little bit, so here are the plots.

The default function to be integrated is $\sin(x^2)+2$, the interval of integration is set $[-1,3]$, the number of partitions of the interval is 4, and the method is the mid-point,

Integration by mid-point method. Partition = 4

We can see the visual integration, the analitic result, the numerical one, and the error. 🙂 Nice, Isn’t it?

Let’s change the number of partitions, say to 10,

Integration by mid-point method. Partition = 10

Much better! But now, let’s try the other methods… left-point,

Integration by left-point method. Partition = 10

The right-point,

Integration by right-point method. Partition = 10

The upper-point,

Integration by upper-point method. Partition = 10

The lower-point,

Integration by lower-point method. Partition = 10

The trapezoid method,

Integration by Trapezoid method. Partition = 10

which is one of the best.

But finally the Simpson method,

Integration by Simpson method. Partition = 10

Impressive!!!

So, I think it’s a good idea to give a try to the interactive mode in SAGE, and if you go thru the code you’ll find out it’s not as difficult as it seems.

Enjoy!

Dox