Pointwise Formula for Left and Right Kan Extensions