I'm confused a bit with the following problem: As far as i understand, the following problem where
$$\min_{w} \omega^{T}\Sigma\omega$$ $$\textrm{s.t.}\hspace{0.5cm} \omega^{T}\mu=E$$ $$ \omega^{T}\textbf{1}=1 $$
yields the analytical solution $$w^{*}=\frac{\Sigma^{-1}\mu}{1'\Sigma^{-1}\mu} $$ where $w$ represents the vector of optimal portfolio weights.
The derivation of the former appears relatively easy as the constraint in the maximization problem is linear thus i can solve the linear system of equations for the lagrange multipliers, plug them back into my first FOC and solve for the weights vector.
The derivation of the analytical form of the equivalent dual representation where i maximize the portfolio return for a given level of portfolio volatility of the form: $$\max_{w} \omega^{T}\mu$$ $$\textrm{s.t.}\hspace{0.5cm} \omega^{T}\Sigma\omega=\sigma^2$$ $$ \omega^{T}\textbf{1}=1 $$ is not so straight forward to me as i'm stuggeling at the point where i try to solve for the lagrange multipliers given the FOC for the portfolio weights: $$\frac{d{L(\dots)}}{d{\omega}}=\mu-2\lambda_{1}\Sigma\omega-\lambda_{2}\textbf{1}=0$$ $$\frac{d{L(\dots)}}{d{\lambda_{1}}}=\sigma^{2}-\omega^{T}\Sigma\omega=0$$ $$\frac{d{L(\dots)}}{d{\lambda_{2}}}=1-\omega^{T}\textbf{1}=0$$
Here, $\mu$ is the vector of expected returns, $\omega$ the vector of asset weights, $\Sigma$ the covariance matrix, $\lambda_{1}$ and $\lambda_{2}$ the lagrange multipliers for constraints 1 and 2 and $\sigma^2$ is my target variance.
The problem here (at least for me) is that the first derivative for the lagrange multiplier of the variance constraint includes two weight-vectors and thus yields a quadratic expression, for which i can't easily solve the second FOC for the needed lagrange multipliers.. and i'm not sure whether i'm on the right track and if yes, how to solve for the analytical expression of $\omega$.
My question: If i want to maximize expected return given my portfolio variance equals some target variance, how does my solution $w$ change and how to explicitly derive this step-by-step (or where can i find some paper where this derivation has been made)?
EDIT: I spent a few hours yesterday night and came up with the closed form for $\omega$ ignoring the sum of weights equal 100% constraint:
In detail: $$\max_{w} \omega^{T}\mu$$ $$\textrm{s.t.}\hspace{0.5cm} \omega^{T}\Sigma\omega=\sigma^2$$
The Lagrangean is: $$L(\dots)=\omega^{T}\mu+\lambda(\sigma^{2}-\omega^{T}\Sigma\omega)$$
for which the FOCs are: $$\frac{dL(\dots)}{d\omega}=\mu-2\lambda\Sigma\omega=0$$ $$\frac{dL(\dots)}{d\lambda}=\sigma^{2}-\omega^{T}\Sigma\omega=0$$
such that $$(\frac{1}{2\lambda}\Sigma^{-1}\mu)\Sigma(\frac{1}{2\lambda}\Sigma^{-1}\mu)=\sigma^2$$ $$\Rightarrow\frac{1}{4\lambda^2}\mu^{T}\Sigma^{-1}\mu=\sigma^2$$ $$\Rightarrow\frac{1}{2\sigma}\sqrt{\mu^{T}\Sigma^{-1}\mu}=\lambda$$
Pugging back into the first FOC: $$\frac{1}{2}(\frac{1}{\frac{1}{2\sigma}\sqrt{\mu^{T}\Sigma^{-1}\mu}})\Sigma^{-1}\mu=\omega$$ and thus: $$\omega^{*}=\frac{\sigma\Sigma^{-1}\mu}{\sqrt{\mu^{T}\Sigma^{-1}\mu}}$$
For the problem with the sum-of-weights constraint the problem is: $$\max_{w} \omega^{T}\mu$$ $$\textrm{s.t.}\hspace{0.5cm} \omega^{T}\Sigma\omega=\sigma^2$$ $$ \omega^{T}\textbf{1}=1 $$
The Lagrangean reads as: $$L(\dots)=\omega^{T}\mu+\lambda_{1}(1-\omega^{T}\textbf{1})+\lambda_{2}(\sigma^{2}-\omega^{T}\Sigma\omega)$$
The FOCs are: $$\frac{dL(\dots)}{d\omega}=\mu--\lambda_{1}\textbf{1}-2\lambda_{2}\Sigma\omega=0$$ $$\frac{dL(\dots)}{d\lambda_1}=1-\omega^{T}\textbf{1}=0$$ $$\frac{dL(\dots)}{d\lambda_1}=\sigma^{2}-\omega^{T}\Sigma\omega=0$$
From the first FOC we get:
$$\omega =\dfrac{1}{2\lambda_1} \Sigma^{-1} ( \mu - \lambda_2 \mathbf{1}) $$
By multiplying this a) with $\Sigma$ and a second time b) with $\textbf{1}$ and using the second and third FOCs:
$$\frac{1}{(2\lambda_1)^2}(\mu -\lambda_2\textbf{1} )^{T}\Sigma^{-1}(\mu-\lambda_2 \textbf{1})=\sigma^2$$ $$\Rightarrow\omega^{T}\mu=\lambda_{1}+2\lambda_{2}\sigma^2$$ and $$\frac{1}{2\lambda_1}\mathbf{1}^{T}\Sigma^{-1}(\mu -\lambda_2\textbf{1} )=1 $$ $$\Rightarrow\omega^{T}\mu=\frac{1}{2\lambda_1}(\mu^{T}\Sigma^{-1}\mu-\lambda_{1}\mu^{T}\Sigma^{-1}\textbf{1})$$
Notation from here onwards: $$A=\mu^{T}\Sigma^{-1}\mu$$ $$B=\mu^{T}\Sigma^{-1}\textbf{1}$$ $$C=\textbf{1}^{T}\Sigma^{-1}\textbf{1}$$
Combining the two equations by $\omega^{T}\mu$ and eliminating $(2\lambda_1)$: $$\lambda_{1}+2\lambda_{2}\sigma^2=\frac{1}{2\lambda_{2}}(A-\lambda_{1})$$
Now using $\omega$ from the first FOC again and multiply both sides with $\textbf{1}$ we get: $$B-\lambda_{1}C=2\lambda_{2}$$
We can substitute this now for $2\lambda_{2}$ in the equation above and get the quadratic expression: $$\lambda_{1}^{2}(C^{2}\sigma^{2}-C)+\lambda_{1}(2B-BC\sigma^2)+(B^{2}\sigma^{2}-A)=0$$
for which we get the messy solution(s): $$\lambda_{1}^{*}=\frac{-(2B-BC\sigma^2)\pm\sqrt{B^{2}(4-3C^{2}\sigma^{4})-AC}}{2C(C\sigma^{2}-1)}$$
We then solve for $\lambda_{1}$, and $\omega$:
$$\lambda_{1}^{*}=B-\frac{-(2B-BC\sigma^2)\pm\sqrt{B^{2}(4-3C^{2}\sigma^{4})-AC}}{4C\sigma^{2}-4}$$
and finally: $$\omega^{*}=\frac{1}{\frac{-(2B-BC\sigma^2)\pm\sqrt{B^{2}(4-3C^{2}\sigma^{4})-AC}}{2C\sigma^{2}-2}}(\Sigma^{-1}\mu-(\frac{-(2B-BC\sigma^2)\pm\sqrt{B^{2}(4-3C^{2}\sigma^{4})-AC}}{4C\sigma^{2}-4})\Sigma^{-1}\textbf{1})$$
My questions now: Is this expression correct? For which values is the expression under the square root positive? Is there a mathematical reasoning, which $\lambda_{2}^{*}$ to use (w.r.t. the $\pm$-sign)?
Thank you again for your help :-) Yours Thomas