Evaluation of Green's boundary formula and its first‐ and second‐order derivatives in Legendre series