Concerning Constraint Equations for Lagrangian Formalism I was working on a problem studying for a classical mechanics class and came across an idea I'm not sure about concerning the formalism of Lagrangian mechanics concerning constraint problems.
https://puu.sh/CLVDd/da4a39bad2.png
To be specific, in the problem of a particle constrained to a hemisphere (picture above), I did some research after getting stuck on what the constraint (constant of motion) should be for this particle and found out that instead of being able to write this problem entirely in terms of the angle $\theta$, you need to include the radial direction. (stack exchange post as reference: https://math.stackexchange.com/questions/1347302/particle-on-a-hemisphere-lagrange_)
Why must we include the radial motion of the particle if we know that it is constrained to not move radially? Is there not some other way to enforce the constraint in terms of theta?
My apologies if this is the wrong place to ask such questions as I am new to the site.
 A: If the particle is constrained to not move radially, this means that its radial component is fixed, i.e. $r = R$ where $r$ is the radial coordinate and $R$ is the hemisphere radius.
If you think about, if a quantity is constrained, it means that there is a condition (equation, inequality, something) that the quantity must obey. So it shouldn't be surprising that the radial coordinate of the particle should feature in some way in the constraint.
A: Is there not some other way to enforce the constraint in terms of theta ?.
yes there is.
The NEWTON  equations of motion  are:
$$m\,\vec{\ddot{u}}=\vec{f}_a+\vec{f}_z\tag 1$$
where
$\vec{{u}}= \begin{bmatrix}
   {x(\vec{q})}\\
   {y(\vec{q})}\\
\end{bmatrix}\quad$
and
$\vec{q}$ the generalized coordinates
$\vec{f}_a$ applied forces include conservative forces
$\vec{f}_z$ constrained forces
the  time derivative of the vector  $\vec{u}$ is:
$\vec{\dot{u}}=J\,\vec{\dot{q}}$ and $\quad \vec{\ddot{u}}=J\,\vec{\ddot{q}}+\dot{J} \vec{\dot{q}}$
with:
$J=\frac{\partial \vec{u}}{\partial \vec{q}}\quad$ and
$\quad \dot{J}=\frac{\partial \left(J\vec{\dot{q}}\right)}{\partial \vec{q}}$
so equation (1) map to:
$$m\,J\,\vec{\ddot{q}}=\vec{f}_a+\vec{f}_c+\vec{f}_z\tag 2$$
with:
$\vec{f}_c=-m\,\frac{\partial \left(J\vec{\dot{q}}\right)}{\partial \vec{q}}\,\vec{\dot{q}}\quad $ Coriolis and centrifugal forces
To eliminate the constrain forces $\vec{f}_z$ from equation (2), we can write the constrained forces  with a  distribution matrix $C_z$ and generalized constrained forces $\vec{\lambda}$.
$\vec{f}_z=C_z\,\vec{\lambda}$
$$m\,J\,\vec{\ddot{q}}=\vec{f}_a+\vec{f}_c+C_z\,\vec{\lambda}\tag 3$$
according to d'alembert approach the product  $J^T\,C_z$ must be zero
multiply equation (3) with $J^T$ yields to:
$$\boxed{J^T\,m\,J\,\vec{\ddot{q}}=J^T\left(\vec{f}_a+\vec{f}_c\right)}\tag 4$$
multiply equation (3) with $C_z^T$ yields to:
$$\boxed{\mathbb{0}=C_z^T\left(\vec{f}_a+\vec{f}_c\right)+C_z^T\,C_z\,\vec{\lambda}}\tag 5$$
equation (4) are the equations of motion for the generalized coordinates $\vec{q}$, with equation (5) you get the generalized constrained forces $\vec{\lambda}$ .
your example
generalized coordinate is $\theta$ and
$\vec{u}=\begin{bmatrix}
   a\sin(\theta)\\
   a\cos(\theta)\\
\end{bmatrix}$
$\Rightarrow$
$J=\begin{bmatrix}
   a\cos(\theta)\\
   -a\sin(\theta)\\
\end{bmatrix}$
Applied force
$f_a=\begin{bmatrix}
   0\\
   -m\,g\\
\end{bmatrix}$
with equation (4) we can calculate the equation of motion for the generalized coordinate $\theta$
to calculate the constrained force we have to construct the matrix $C_z$ that fulfill the equation $J^T\,C_z=\mathbb{0}$
$\Rightarrow$
$C_z=\left[ \begin {array}{c} a\sin \left( \theta \right) 
\\ a\cos \left( \theta \right) \end {array} \right] 
$
with equation (5) we can calculate the generalized constrained force $\lambda$
