# Using Matlab for integration

1. Dec 12, 2004

### furkang

I used matlab to calculate the integration of a basic function.
I wrote :

F = inline('(2*x)+((x.^3)/0.000441)')

I want to calculate integral of F from 0.01 to 0.05
but the real answer is 0.361

I am sure the function F is correct (I have tried some values).

is there any problem with "Q = quad(F,0.01,0.05)" command???

2. Dec 13, 2004

### gerben

Why do you think the real answer is 0.361?
I see that
F(0.05) - F(0.01) = 0.361
but this is of course not the integral, the integral is smaller.

The function is increasing and so on the interval [0.01, 0.05] it is maximum at 0.05, there it is 0.3834. Overestimating the integral by assuming that F would be 0.3834 everywhere in the interval [0.01, 0.05] would give an area: 0.3834 * 0.04 = 0.0153