Can we use the following formula to get both?

Rp = Ri + [(B/E) x ( Ri -c)]

I know the book list effect leverage on duration formula as De = (Di I - Db B)/ E

But when I was doing practice problems I used the return formula when trying to calculate duration and still got the correct answer??