Coupling of symmetric operators and the third Green identity