We consider the Markov problem of finding the so-called Markov factor M ( U , K ) : = sup u ∈ U ‖ D u ‖ ‖ u ‖ , of the set of differentiable functions U , where D u : = | ∂ u | ℓ 2 stands for the ℓ 2 -norm of the gradient vector of u , and ‖ ⋅ ‖ is the weighted L 2 norm on the set K ⊂ R d . In the univariate case exact L 2 -Markov inequalities are known for algebraic polynomials on the real line, half line and intervals. We outline a variational approach to the above problem and show how this leads either to certain partial differential equations, or to a system of homogeneous linear equations. This method will be illustrated by using it to solve the L 2 Markov problem for the cases of d -dimensional spaces and d -dimensional hyperquadrants. In the case of d -spaces the solution is given for homogeneous polynomials, as well.