Two asset Markowitz Portfolio Optimization and Capital-Market Line construction for a Given Risk Free Rate

I practice with some excercises about the Markowitz theory. If we have a portfolio with two stocks A and B, with given return $r_A$ and $r_B$, the expected return can be computed as: $r_P= w_A \cdot r_A + (1-w_A) \cdot r_B$, where $w_A$ is the weight invested in stock A.

For a given risk free rate ($r_f$), I now have to compute the return of the one fund of the one fund theorem. What I am exactly supposed to do here? I know about the one fund theorem, but I don't know what to do. Any hints?

The Sharpe ratio tells us the amount of excess return we get for taking on each additional unit of portfolio standard deviation. $$\frac{\mu_p - r_f}{\sigma_p }$$

We are looking for the combination of the two risky assets with the highest Sharpe ratio ($P^*$). Once we do that, we can take linear combinations of that portfolio and the risk-less asset and form the Capital-Market Line. This is usually solved for numerically rather than analytically but it is possible to do so analytically, particularly in the two asset case.

A portfolio $p$ has an expected return of: $$\mu_p(W_A) = w_A \cdot \mu_A + (1 - w_A) \cdot \mu_B$$

and a standard deviation of: $$\sigma_p(W_A) = \sqrt(w^2_A \cdot \sigma^2_A + (1 - w_A)^2 \cdot \sigma^2_B + 2(1-W_A)W_A \sigma_{AB})$$ where $\sigma^2_A$ is the variance of asset $A$, $\sigma^2_B$ is the variance of asset $B$, and $\sigma_{AB}$ is their covariance. It therefore has a Sharpe Ratio of:

$$\frac{\mu_p(W_A) - r_f}{\sigma_p(W_A) } = \frac{w_A \cdot \mu_A + (1 - w_A) \cdot \mu_B}{+\sqrt(w^2_A \cdot \sigma^2_A + (1 - w_A)^2 \cdot \sigma^2_B + 2(1-W_A)W_A \sigma_{AB})}$$

To maximize this you'll want to solve: $$\frac{d}{dW_A} \frac{\mu_p(W_A) - r_f}{\sigma_p(W_A) } = 0$$ $\Rightarrow W^{*}_A$ s.t. $P(W^{*}_A)=P^*$ and check that the second order condition is met: $$\frac{d^2}{dW^2_A} \frac{\mu_p(W_A) - r_f}{\sigma_p(W_A) } < 0$$

The algebra is a bit hairy but there is nothing tricky from here on out.