Let Q be the function you want to minimize.

Just solve the simultaneous equation and in the usual way.

Alternatively, we might notice that in the usual matrix notation

where and solve with matrix calculus.

An obvious application is where we think that the variance grows proportionally with , so we could take