Reference an aligned equation inside a gather environment

I have the below code

\begin{gather} V(x,y) = 0 \Rightarrow \begin{aligned}
{V_x}(x,y) &= \frac{{{y^2}(12 - 2xy - {x^2})}}{{2{{(x + y)}^2}}} = 0,\\
{V_y}(x,y) &= \frac{{{x^2}(12 - 2xy - {y^2})}}{{2{{(x + y)}^2}}} = 0.
\end{aligned}\\
\end{gather}


How can I cross-reference the equation \frac{{{y^2}(12 - 2xy - {x^2})}}{{2{{(x + y)}^2}}} = 0?

The following solution borrows heavily (steals??) from this answer of @egreg's to the question nested equations numbering.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align}
&\makebox[0pt][l]{\smash{\raisebox{-1\baselineskip}{%
$\mathllap{V(x,y) = 0\ }\Rightarrow\quad$ }}}
V_x(x,y) = \frac{y^2(12 - 2xy - x^2)}{2(x + y)^2} = 0, \\
V_y(x,y) = \frac{x^2(12 - 2xy - y^2)}{2(x + y)^2} = 0.\\[2\jot]
\end{align}
\end{document}


Addendum: The OP has posted a follow-up request for a version of the three-equation group without a \Rightarrow at the start of the third line, and with the first = symbol in the third line aligned with the first = symbols in the two preceding lines. Here goes.

\documentclass{article}
\usepackage{mathtools,showframe}
\begin{document}
\begin{align}
\makebox[0pt][l]{\smash{\raisebox{-1\baselineskip}{%
$\mathllap{V(x,y) = 0\ }\Rightarrow\quad$}}}
V_x(x,y) &= \frac{y^2(12 - 2xy - x^2)}{2(x + y)^2} = 0, \\
V_y(x,y) &= \frac{x^2(12 - 2xy - y^2)}{2(x + y)^2} = 0.\\[2\jot]
\end{align}
\end{document}

• Wonderful solution. Nov 7, 2021 at 17:10
• @Dr.KareemElgindy - You're most welcome! If you believe that I've fully answered your question, I'd appreciate if you would "accept" my answer, by clicking on the green checkmark symbol. ;-)
– Mico
Nov 8, 2021 at 7:57
• Done bro. BTW, if I wanted to remove the right arrow from Eq. (3) and align the first equality of that line with the equality of V(x,y) in the above line, can you still do that while keeping everything else the same? Nov 8, 2021 at 19:08
– Mico
Nov 8, 2021 at 20:38
• I highly appreciate your efforts @Mico. However, this is not exactly what I desired. I meant to align with V(x,y) not with V_x and V_y. Nov 9, 2021 at 7:28

If I had to do this I'd probably use align and fudge the spacing...

\documentclass{article}

\usepackage{amsmath}

\begin{document}

gather
\begin{gather}
V(x,y) = 0 \Rightarrow \begin{aligned}
{V_x}(x,y) &= \frac{{{y^2}(12 - 2xy - {x^2})}}{{2{{(x + y)}^2}}} = 0,\\
{V_y}(x,y) &= \frac{{{x^2}(12 - 2xy - {y^2})}}{{2{{(x + y)}^2}}} = 0.
\end{aligned}\\