# Is Kullback-Leibler Divergennce not equal to Relative Entropy?

In many books, Kullback-Leibler Divergence is equal to Relative Entropy. $$D_{kl}(u,v) = \sum_{i=1}^n(u_ilog(u_i/v_i).$$ However, I find in the book, Convex Optimization (Stephen Boyd) page 90, the KL Divergence is defined as, $$D_{kl}(u,v) = \sum_{i=1}^n(u_ilog(u_i/v_i)-u_i+v_i).$$ Why KL Divergence has these two different definition? Which one is correct?

• The book (also written by Vandenberghe) clearly mentions "Note that the relative entropy and the Kullback-Leibler divergence are the same when u and v are probability vectors, i.e., satisfy 1Tu = 1Tv = 1.)" – LinAlg Dec 20 '18 at 2:45

They're equivalent because $$\sum_i u_i=\sum_i v_i=1$$.