Use appropriate quadrature formulae out of the trapezoidal and Simpson's rules to numerically integrate $\int_0^1\frac{dx}{1+x^2}$ with $h=0.2$. Hence obtain an approximate value of $\pi$. Justify the use of a particular quadrature formula.
Answer:
In this problem trapezoidal rule gave better solution than Simpson's 1/3 rule. How can I justify?
The way you are applying the Simpson rule is wrong. With $h=0.2$ you get 6 points. The standard Simpson formula (that which you are using) requires an odd number of points (so that the sequence of coefficients in the sum is symmetric: $1,4,2,4, \cdots, 4 , 2 ,4,1$).
One of the possible solutions is suggested here. With that correction, I get $3.14136/4$, a much better approximation than the trapezoidal rule.
You can (you should) verify the correctness of your formula by considering what would happen to a constant function, say $f(x)=1$ - in which case any decent numerical integration scheme should be exact:
$$h \frac{1}{3}(1+4+2+4+2+1)=\frac{14}{15}\ne 1$$