Closed-form expressions for integrals of MKdV and sine-Gordon maps