I am reading https://xyang35.github.io/2017/04/14/variational-lower-bound/ second derivation for KL divergence.
if you check equation, you will see at the end it gets: $$ = -L + \log P(X) $$ But I can not understand how we isolated $\log P(X)$ since it is multiplied with summation of $Q(z)$ in the row before.
I did check on this matter and it says $Q(z)$ is just 1. Ok, but why we didn't use 1 in first term as well and we would get: $$ = \log \frac{P(x,z)}{Q(z)} + \log P(x) $$ How could $Q(z)$ just disappear in second term?