Determine coefficients $A_k ; k=1,2,3,4$ in the following quadratic formula $$\int_{-1}^{1}f(x)dx=A_1f(-1)+A_2f(1)+A_3f'(-1)+A_4f(1)+R$$ such that it has the maximum possible algebraic degree of accuracy. Evaluate an error, and using the obtained formula evaluate the following integral:
$$\int_0^{\pi/2}\sin xdx.$$
Could someone explain in details how to solve these types of problems?