A simpler way is derive the sharpe ratio, and use that to solve for the standard deviation of the levered portfolio, the ratio of the new sd/old sd is your leverage.
You will get a different answer if you use the ratio of standard deviations vs using the previously mentioned formulas where you calculate leverage based off of expected return. The weighted standard deviations using simple arithmetic weightin will over state risk therefore you will get a different answer using arithmetic SD ratios.
Are you all just asking how you would solve for the e® when including the RFR? It’s the same as you would when choosing any other corner portfolio. There is no difference.
Guys it’s the exact same formula for 2 corner portfolios but Rf instead the corner portfolio. That’s it. The formula of (levered return = unlevered return + [D/E * (unlevered return - cost)] is exactly the same formula of w and 1-w !!!
Where are you getting the Standard deviation of the portfolio from? Your method works if you are given standard deviation or the Sharpe of the final portfolio - otherwise you don’t know what the Sharpe is and cannot solve for SD of the portfolio.
Essentially adding a risk free asset reduces the standard deviation of the final portfolio so the method you are using does not work without having the SD of the final portfolio provided.