Deriving CAPM from efficient frontier
The derivation introduces a risk-free asset to the efficient frontier, forming the capital market line with the tangency portfolio as the market portfolio. Using mean-variance optimization and equilibrium assumptions, it shows expected returns satisfy the security market line: E[Ri] = rf + βi(E[RM] − rf), where βi reflects covariance with the market portfolio.
A convenient way of organising the argument is to start from the classical mean–variance problem. Given (n) risky securities with (column) vector of expected returns (\boldsymbol{\mu}) and nonsingular covariance matrix (\Sigma), the efficient frontier of risky portfolios is defined as the set of portfolios
[
\min_{w};w^{\top}\Sigma w\quad\text{s.t.}\quad w^{\top}\boldsymbol{\mu}=\mu_p,;w^{\top}\mathbf{1}=1,
]
where (w) is the (n)-vector of portfolio weights. Solving the first order conditions with Lagrange multipliers (\alpha,\beta) gives
[
\Sigma w=\tfrac{1}{2}\alpha,\boldsymbol{\mu}+\tfrac{1}{2}\beta,\mathbf{1},
]
so the efficient set is a parabola in ((\sigma,\mu))-space.
Now introduce a risk–free asset paying (r_f). Forming convex combinations of any risky portfolio (P) and the risk–free asset yields a straight line
[
\mu=;r_f+ \frac{\mu_P-r_f}{\sigma_P},\sigma
]
in the ((\sigma,\mu))-plane. Among all such “capital allocation lines” the one with the greatest slope, i.e. the greatest Sharpe ratio ((\mu_P-r_f)/\sigma_P), is obtained by choosing the risky portfolio (P) that solves
[
\max_{w};\frac{w^{\top}\boldsymbol{\mu}-r_f}{\sqrt{w^{\top}\Sigma w}};.
]
The first–order condition for this problem can be written as
[
\Sigma w \propto \boldsymbol{\mu}-r_f,\mathbf{1},
]
so the unique tangency portfolio has weights proportional to (\Sigma^{-1}(\boldsymbol{\mu}-r_f\mathbf{1})). The corresponding line from (r_f) to this tangency point is the capital market line.
In the CAPM all investors face the same (\boldsymbol{\mu},\Sigma) and can lend and borrow at (r_f), so by the two–fund separation theorem they all hold the same tangency portfolio (M) of risky assets, combined with the risk–free asset. Market clearing then requires that this tangency portfolio coincides with the value–weighted market portfolio.
The fact that (M) is mean–variance efficient implies that there is a scalar (\lambda) such that
[
\boldsymbol{\mu}-r_f\mathbf{1}=\lambda,\Sigma w^{M}.
]
Premultiplying by (w^{M\top}) yields (\lambda=(\mu_M-r_f)/(w^{M\top}\Sigma w^M)=(\mu_M-r_f)/\sigma_M^2). Taking the (i)‑th component of the vector equation then gives, for any asset (i),
[
\mu_i - r_f = \frac{\operatorname{cov}(R_i,R_M)}{\sigma_M^2},(\mu_M-r_f)
= \beta_i\bigl(\mu_M-r_f\bigr),
]
where (\beta_i:=\operatorname{cov}(R_i,R_M)/\sigma_M^2). This is the familiar security market line: in equilibrium the expected excess return on any asset is proportional to its beta with the market, with slope equal to the market risk premium.