# Lagrangian for two coupled second order linear differential equations

Consider a system of two coupled linear differential equations $$\left( \begin{bmatrix} \Omega \end{bmatrix}^{-1} + \frac{d^2}{dt^2} \right) \vec{V}(t) = \begin{bmatrix} C \end{bmatrix}^{-1} \vec{J}(t) + \begin{bmatrix} \Omega \end{bmatrix}^{-1} \vec{K}(t)$$ where $$\vec{V}(t)$$ is a two-element vector describing the degree of freedom of the system, $$\vec{J}(t)$$ and $$\vec{K}(t)$$ are drive sources, and $$[\Omega]^{-1}$$ and $$[C]^{-1}$$ are constant 2x2 matrices. This system represents two coupled harmonic resonators with time-dependent (but position independent) drive forces. For whatever it's worth, suppose we can decompose $$[\Omega]^{-1}$$ as $$[\Omega]^{-1} = [C]^{-1}[L]^{-1}$$ where $$[L]^{-1}$$ is another 2x2 matrix$$^{[1]}$$. Both $$[L]$$ and $$[C]$$ are symmetric.

Is there a systematic way to find the Lagrangian for this system of equations?

[1]: Both $$[C]$$ and $$[L]$$ have the property that their off-diagonal elements are smaller than their diagonal elements, which is probably useful for approximations.

• Are you talking about two coupled driven oscillators with two different position-independent but time dependent driving forces? Commented Apr 20, 2020 at 16:44
• Are the matrices (anti)symmetric? Commented Apr 20, 2020 at 16:47
• Are $\Omega$ and $C$ time or position dependent or are they just constants ? You really need to be more specific about all the quantities. Commented Apr 20, 2020 at 17:14
• @CosmasZachos yes. Commented Apr 20, 2020 at 19:25
• @Qmechanic $[L]$ and $[C]$ are both symmetric. I have updated the post. Commented Apr 20, 2020 at 19:26

$$\boldsymbol{\S}$$ A. A special case : symmetric $$\Omega^{\boldsymbol{-}1}$$

Let the $$2\times2$$ real symmetric matrices $$$$C^{\boldsymbol{-}1}\boldsymbol{=} \begin{bmatrix} \xi_1 & \xi \vphantom{\dfrac{a}{b}}\\ \xi &\xi_2 \vphantom{\dfrac{a}{b}} \end{bmatrix} \quad \text{and} \quad L^{\boldsymbol{-}1}\boldsymbol{=} \begin{bmatrix} \eta_1 & \eta \vphantom{\dfrac{a}{b}}\\ \eta &\eta_2 \vphantom{\dfrac{a}{b}} \end{bmatrix} \tag{A-01}\label{A-01}$$$$ Then $$$$\Omega^{\boldsymbol{-}1}\boldsymbol{=}C^{\boldsymbol{-}1}L^{\boldsymbol{-}1}\boldsymbol{=} \begin{bmatrix} \xi_1\eta_1 \boldsymbol{+} \xi\eta & \xi_1\eta \boldsymbol{+} \xi\eta_2 \vphantom{\dfrac{a}{b}}\\ \hphantom{_1}\hphantom{_2}\xi\eta_1 \boldsymbol{+} \xi_2\eta & \hphantom{_1}\hphantom{_2}\xi\eta \boldsymbol{+}\xi_2\eta_2 \vphantom{\dfrac{a}{b}} \end{bmatrix} \tag{A-02}\label{A-02}$$$$ With respect to the coordinates $$$$\mathbf{V} \boldsymbol{=} \begin{bmatrix} V_1\vphantom{\dfrac{a}{b}}\\ V_2\vphantom{\dfrac{a}{b}} \end{bmatrix} \tag{A-03}\label{A-03}$$$$
the two coupled equations are $$$$\dfrac{\mathrm d}{\mathrm dt}\left(\mathbf{\dot{V}}\right)\boldsymbol{-}\left(C^{\boldsymbol{-}1}\mathbf{J}\boldsymbol{+}\Omega^{\boldsymbol{-}1}\mathbf{K}\boldsymbol{-}\Omega^{\boldsymbol{-}1}\mathbf{V}\right)\boldsymbol{=}\boldsymbol{0} \tag{A-04}\label{A-04}$$$$ Now, if there exists a Lagrangian $$\mathrm L\left(\mathbf{V},\mathbf{\dot{V}},t\right)$$ for the problem then the Euler-Lagrange equations are $$$$\dfrac{\mathrm d}{\mathrm dt}\left(\dfrac{\partial \mathrm L}{\partial \mathbf{\dot{V}}}\right)\boldsymbol{-}\dfrac{\partial \mathrm L}{\partial \mathbf{V}}\boldsymbol{=}\boldsymbol{0} \tag{A-05}\label{A-05}$$$$ where $$$$\dfrac{\partial \mathrm L}{\partial \mathbf{V}}\boldsymbol{=} \begin{bmatrix} \dfrac{\partial \mathrm L}{\partial V_1} \vphantom{\dfrac{a}{\dfrac{a}{b}}}\\ \dfrac{\partial \mathrm L}{\partial V_2} \vphantom{\dfrac{a}{b}} \end{bmatrix} \quad \text{and} \quad \dfrac{\partial \mathrm L}{\partial \mathbf{\dot{V}}}\boldsymbol{=} \begin{bmatrix} \dfrac{\partial \mathrm L}{\partial \dot{V}_1} \vphantom{\dfrac{a}{\dfrac{a}{b}}}\\ \dfrac{\partial \mathrm L}{\partial \dot{V}_2} \vphantom{\dfrac{a}{b}} \end{bmatrix} \tag{A-06}\label{A-06}$$$$ Comparing equations \eqref{A-04} and \eqref{A-05} we note that the Lagrangian $$\mathrm L\left(\mathbf{V},\mathbf{\dot{V}},t\right)$$ must satisfy, except constants, the following two equations \begin{align} \dfrac{\partial \mathrm L}{\partial \mathbf{\dot{V}}} & \boldsymbol{=}\mathbf{\dot{V}}\vphantom{\dfrac{a}{\dfrac{a}{b}}} \tag{A-07a}\label{A-07a}\\ \dfrac{\partial \mathrm L}{\partial \mathbf{V}} & \boldsymbol{=}C^{\boldsymbol{-}1}\mathbf{J}\boldsymbol{+}\Omega^{\boldsymbol{-}1}\mathbf{K}\boldsymbol{-}\Omega^{\boldsymbol{-}1}\mathbf{V} \tag{A-07b}\label{A-07b} \end{align} From equation \eqref{A-07a} and partly because of the first two terms in the rhs of equation \eqref{A-07b} we note that one part $$\mathrm L_1\left(\mathbf{V},\mathbf{\dot{V}},t\right)$$ of the Lagrangian would be $$$$\mathrm L_1\left(\mathbf{V},\mathbf{\dot{V}},t\right)\boldsymbol{=}\frac12\left(\mathbf{\dot{V}}\boldsymbol{\cdot}\mathbf{\dot{V}}\right)\boldsymbol{+}\left[\left(C^{\boldsymbol{-}1}\mathbf{J}\right)\boldsymbol{\cdot}\mathbf{V}\right]\boldsymbol{+}\left[\left(\Omega^{\boldsymbol{-}1}\mathbf{K}\right)\boldsymbol{\cdot}\mathbf{V}\right] \tag{A-08}\label{A-08}$$$$ while a second part $$\mathrm L_2\left(\mathbf{V},\mathbf{\dot{V}},t\right)$$ of the Lagrangian must satisfy the equation $$$$\dfrac{\partial \mathrm L_2}{\partial \mathbf{V}} \boldsymbol{=}\boldsymbol{-}\Omega^{\boldsymbol{-}1}\mathbf{V} \tag{A-09}\label{A-09}$$$$ If the matrix $$\Omega^{\boldsymbol{-}1}$$ of equation \eqref{A-02} is symmetric, that is if the elements of the matrices $$C^{\boldsymbol{-}1}$$ and $$L^{\boldsymbol{-}1}$$ satisfy the condition $$$$\left(\xi_1\boldsymbol{-}\xi_2\right)\eta\boldsymbol{=}\left(\eta_1\boldsymbol{-}\eta_2\right)\xi \tag{A-10}\label{A-10}$$$$ then $$$$\mathrm L_2\left(\mathbf{V},\mathbf{\dot{V}},t\right) \boldsymbol{=}\boldsymbol{-}\frac12\left[\left(\Omega^{\boldsymbol{-}1}\mathbf{V}\right)\boldsymbol{\cdot}\mathbf{V}\right] \tag{A-11}\label{A-11}$$$$ and so \begin{align} &\mathrm L\left(\mathbf{V},\mathbf{\dot{V}},t\right) \boldsymbol{=}\mathrm L_1\left(\mathbf{V},\mathbf{\dot{V}},t\right)\boldsymbol{+}\mathrm L_2\left(\mathbf{V},\mathbf{\dot{V}},t\right) \qquad \textbf{for symmetric } \Omega^{\boldsymbol{-}1} \nonumber\\ & \boldsymbol{=}\frac12\left(\mathbf{\dot{V}}\boldsymbol{\cdot}\mathbf{\dot{V}}\right)\boldsymbol{-}\frac12\left[\left(\Omega^{\boldsymbol{-}1}\mathbf{V}\right)\boldsymbol{\cdot}\mathbf{V}\right]\boldsymbol{+}\left[\left(C^{\boldsymbol{-}1}\mathbf{J}\right)\boldsymbol{\cdot}\mathbf{V}\right]\boldsymbol{+}\left[\left(\Omega^{\boldsymbol{-}1}\mathbf{K}\right)\boldsymbol{\cdot}\mathbf{V}\right] \tag{A-12}\label{A-12} \end{align}

$$\boldsymbol{=\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!=}$$

$$\boldsymbol{\S}$$ B. The general case : A systematic way to find the Lagrangian for two coupled second order linear differential equations

The efforts to find a Lagrangian for two coupled second order linear differential equations (as in the question) would be unsuccessful because of the so called $$^{\prime\prime}$$cross terms$$^{\prime\prime}$$ that appear at an intermediate step , for example terms like $$V_1 V_2, \dot{V}_1 \dot{V}_2, \dot{V}_1 V_2$$ etc. These terms "couple" the two equations. So we must find a method to eliminate terms of this kind. This will give us at first two uncoupled second order linear differential equations and next a well-defined Lagrangian.

Because of linearity we make a change of the variables from old $$V_1, V_2$$ to new $$q_1, q_2$$ via a linear transformation \begin{align} V_1 & \boldsymbol{=}a_{11}q_1\boldsymbol{+}a_{12}q_2 \tag{B-01a}\label{B-01a}\\ V_2 & \boldsymbol{=}a_{21}q_1\boldsymbol{+}a_{22}q_2 \tag{B-01b}\label{B-01b} \end{align} or $$$$\mathbf{V}\boldsymbol{=} \begin{bmatrix} V_1\vphantom{\dfrac{a}{b}}\\ V_2\vphantom{\dfrac{a}{b}} \end{bmatrix} \boldsymbol{=} \begin{bmatrix} a_{11} & a_{12}\vphantom{\dfrac{a}{b}}\\ a_{21} & a_{22}\vphantom{\dfrac{a}{b}} \end{bmatrix} \begin{bmatrix} p_1\vphantom{\dfrac{a}{b}}\\ p_2\vphantom{\dfrac{a}{b}} \end{bmatrix} \boldsymbol{=}A\mathbf{q} \tag{B-02}\label{B-02}$$$$
that is $$$$\mathbf{V}\boldsymbol{=}A\mathbf{q} \,,\qquad A\boldsymbol{=} \begin{bmatrix} a_{11} & a_{12}\vphantom{\dfrac{a}{b}}\\ a_{21} & a_{22}\vphantom{\dfrac{a}{b}} \end{bmatrix} \tag{B-03}\label{B-03}$$$$ and we'll try to find, if there exists, an invertible transformation $$\:A\:$$ that eliminates the cross terms so uncoupling the two equations.

If on our initial equation
$$$$\mathbf{\ddot{V}}\boldsymbol{+}\Omega^{\boldsymbol{-}1}\mathbf{V}\boldsymbol{=}C^{\boldsymbol{-}1}\mathbf{J}\boldsymbol{+}\Omega^{\boldsymbol{-}1}\mathbf{K} \tag{B-04}\label{B-04}$$$$ we apply from the left the transformation $$\:A^{\boldsymbol{-}1}\:$$ we have $$$$A^{\boldsymbol{-}1}\mathbf{\ddot{V}}\boldsymbol{+}A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}\mathbf{V}\boldsymbol{=}A^{\boldsymbol{-}1}C^{\boldsymbol{-}1}\mathbf{J}\boldsymbol{+}A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}\mathbf{K} \tag{B-05}\label{B-05}$$$$ Making use of \eqref{B-03} we replace $$\:\mathbf{V}\:$$ by $$\:A\mathbf{q}\:$$ so $$$$A^{\boldsymbol{-}1}\left(A\mathbf{\ddot{q}}\right)\boldsymbol{+}A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}\left(A\mathbf{q}\right)\boldsymbol{=}A^{\boldsymbol{-}1}C^{\boldsymbol{-}1}\mathbf{J}\boldsymbol{+}A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}\mathbf{K} \nonumber$$$$ that is $$$$\mathbf{\ddot{q}}\boldsymbol{+}\left(A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1} A\right)\mathbf{q}\boldsymbol{=}\left(A^{\boldsymbol{-}1}C^{\boldsymbol{-}1 }A\right)\mathbf{j}\boldsymbol{+}\left(A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1 }A\right)\mathbf{k} \tag{B-06}\label{B-06}$$$$ or \begin{align} &\mathbf{\ddot{q}}\boldsymbol{+}W\,\mathbf{q} \boldsymbol{=}U\,\mathbf{j}\boldsymbol{+}W\,\mathbf{k} \tag{B-07a}\label{B-07a}\\ &\text{where} \nonumber\\ &W\boldsymbol{=}A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}A\,, \quad U\boldsymbol{=}A^{\boldsymbol{-}1}C^{\boldsymbol{-}1}A\,, \quad \mathbf{j}\boldsymbol{=}A^{\boldsymbol{-}1}\mathbf{J}\,,\quad \mathbf{k}\boldsymbol{=}A^{\boldsymbol{-}1}\mathbf{K} \tag{B-07b}\label{B-07b} \end{align} Now, the two second order linear differential equations \eqref{B-07a} would be uncoupled if the matrix $$\:W\:$$ could be diagonal $$$$W\boldsymbol{=}A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1 }A\boldsymbol{=} \begin{bmatrix} \mathrm w_1 & 0 \vphantom{\dfrac{a}{b}}\\ 0 & \mathrm w_2\vphantom{\dfrac{a}{b}} \end{bmatrix} \tag{B-08}\label{B-08}$$$$ This uncoupling is shown explicitly below \begin{align} \ddot{q}_1\boldsymbol{+}\mathrm w_1 p_1 &\boldsymbol{=}\left(U\,\mathbf{j}\right)_1 \boldsymbol{+}\left(W\,\mathbf{k}\right)_1 \tag{B-09a}\label{B-09a}\\ \ddot{q}_2\boldsymbol{+}\mathrm w_2 p_2 &\boldsymbol{=}\left(U\,\mathbf{j}\right)_2 \boldsymbol{+}\left(W\,\mathbf{k}\right)_2 \tag{B-09b}\label{B-09b} \end{align} These two independent $$^{\prime\prime}$$motions$$^{\prime\prime}$$ are called normal modes and the variables $$q_1,q_2$$ normal coordinates.

Now, from \eqref{B-08} the constants $$\:\mathrm w_1,\mathrm w_2\:$$ are the eigenvalues of the matrix $$\:\Omega^{\boldsymbol{-}1}\:$$ while the columns of the matrix $$\:A\:$$ are the eigenvectors respectively \begin{align} \mathbf{a}_1 & \boldsymbol{=} \begin{bmatrix} a_{11} \vphantom{\dfrac{a}{b}}\\ a_{21} \vphantom{\dfrac{a}{b}} \end{bmatrix}\boldsymbol{=}\text{eigenvector of eigenvalue } \mathrm w_1 \tag{B-10a}\label{B-10a}\\ \mathbf{a}_2 & \boldsymbol{=} \begin{bmatrix} a_{12} \vphantom{\dfrac{a}{b}}\\ a_{22} \vphantom{\dfrac{a}{b}} \end{bmatrix}\boldsymbol{=}\text{eigenvector of eigenvalue } \mathrm w_2 \tag{B-10b}\label{B-10b} \end{align} Note that depending on the matrix $$\:\Omega^{\boldsymbol{-}1}\:$$ the eigenvalues $$\:\mathrm w_1,\mathrm w_2\:$$ could be either both real or both complex conjugates.

Now, since the diagonal matrix $$\:W\:$$ is symmetric we make use of the results of $$\boldsymbol{\S}$$ A and we build the Lagrangian for the Euler-Lagrange equations \eqref{B-09a},\eqref{B-09b} according to equation \eqref{A-12}
$$$$\mathrm L\left(\mathbf{q},\mathbf{\dot{q}},t\right) \boldsymbol{=} \tfrac12\left(\mathbf{\dot{q}}\boldsymbol{\cdot}\mathbf{\dot{q}}\right)\boldsymbol{-}\tfrac12\left[\left(W\mathbf{q}\right)\boldsymbol{\cdot}\mathbf{q}\vphantom{\dfrac{a}{b}}\right]\boldsymbol{+}\left[\left(U\mathbf{j}\right)\boldsymbol{\cdot}\mathbf{q}\vphantom{\dfrac{a}{b}}\right]\boldsymbol{+}\left[\left(W\mathbf{k}\right)\boldsymbol{\cdot}\mathbf{q}\vphantom{\dfrac{a}{b}}\right] \tag{B-11}\label{B-11}$$$$ Explicitly \begin{align} \mathrm L\left(\mathbf{q},\mathbf{\dot{q}},t\right) & \boldsymbol{=} \tfrac12\left(\dot{q}^2_1\boldsymbol{+}\dot{q}^2_2\right)\boldsymbol{-}\tfrac12\left(\mathrm w_1 q^2_1\boldsymbol{+}\mathrm w_2 q^2_2\right) \tag{B-12}\label{B-12}\\ &\boldsymbol{+} \left[\left(U\mathbf{j}\right)_1\boldsymbol{+}\left(W\mathbf{k}\right)_1\vphantom{\dfrac{a}{b}}\right]q_1\boldsymbol{+} \left[\left(U\mathbf{j}\right)_2\boldsymbol{+}\left(W\mathbf{k}\right)_2\vphantom{\dfrac{a}{b}}\right]q_2 \nonumber \end{align} Note that the above Lagrangian doesn't contain $$^{\prime\prime}$$cross terms$$^{\prime\prime}$$ like $$q_1 q_2, \dot{q}_1 \dot{q}_2, \dot{q}_1 q_2$$ etc. Use of this Lagrangian in the equations below \begin{align} \dfrac{\mathrm d}{\mathrm dt}\left(\dfrac{\partial \mathrm L}{\partial \dot{q}_1}\right)\boldsymbol{-}\dfrac{\partial \mathrm L}{\partial q_1}\boldsymbol{=}0 \tag{B-13a}\label{B-13a}\\ \dfrac{\mathrm d}{\mathrm dt}\left(\dfrac{\partial \mathrm L}{\partial \dot{q}_2}\right)\boldsymbol{-}\dfrac{\partial \mathrm L}{\partial q_2}\boldsymbol{=}0 \tag{B-13b}\label{B-13b} \end{align} yields equations \eqref{B-09a} and \eqref{B-09b} as expected.

Now, based on \eqref{B-11} we can build the Lagrangian $$\:\mathrm L\left(\mathbf{V},\mathbf{\dot{V}},t\right)\:$$ for the initial coordinates $$\:V_1,V_2\:$$ from $$\:\mathrm L\left(\mathbf{q},\mathbf{\dot{q}},t\right)$$. We simply replace $$\:\mathbf{q}\:$$ by $$\:A^{\boldsymbol{-}1}\mathbf{V}\:$$ in \eqref{B-11} and we have \begin{align} &\mathrm L\left(\mathbf{V},\mathbf{\dot{V}},t\right)\boldsymbol{=} \tag{B-14}\label{B-14}\\ &\tfrac12\left[\left(A^{\boldsymbol{-}1}\mathbf{\dot{V}}\right)\boldsymbol{\cdot}\left(A^{\boldsymbol{-}1}\mathbf{\dot{V}}\right)\vphantom{\dfrac{a}{b}}\right]\boldsymbol{-}\tfrac12\left[\left(A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}\mathbf{V}\right)\boldsymbol{\cdot}\left(A^{\boldsymbol{-}1}\mathbf{V}\right)\vphantom{\dfrac{a}{b}}\right] \nonumber\\ &\boldsymbol{+}\left[\left(A^{\boldsymbol{-}1}C^{\boldsymbol{-}1}\mathbf{J}\right)\boldsymbol{\cdot}\left(A^{\boldsymbol{-}1}\mathbf{V}\right)\vphantom{\dfrac{a}{b}}\right]\boldsymbol{+}\left[\left(A^{\boldsymbol{-}1}\Omega^{\boldsymbol{-}1}\mathbf{K}\right)\boldsymbol{\cdot}\left(A^{\boldsymbol{-}1}\mathbf{V}\right)\vphantom{\dfrac{a}{b}}\right] \nonumber \end{align} If $$\:\Omega^{\boldsymbol{-}1}\:$$ is (real) symmetric then the Lagrangian of \eqref{B-14} must yield that of \eqref{A-12}. But these two expressions are very different and it seems that we have a contradiction here. But there is no contradiction : in case of symmetric matrix $$\:\Omega^{\boldsymbol{-}1}\:$$ the eigenvalues $$\:\mathrm w_1,\mathrm w_2\:$$ are both real, the eigenvectors $$\:\mathbf{a}_1,\mathbf{a}_2$$ of equations \eqref{B-10a},\eqref{B-10b} are orthogonal and the matrix $$\:A\:$$ of equations \eqref{B-02},\eqref{B-03} is orthogonal . For this matrix we have $$\:A^{\boldsymbol{-}1}\boldsymbol{=}A^{\boldsymbol{\top}}\boldsymbol{=}\text{transpose of }A$$. Replacing $$\:A^{\boldsymbol{-}1}\:$$ by $$\:A^{\boldsymbol{\top}}\:$$ the expression \eqref{B-14} becomes identical to \eqref{A-12}.In other words, since $$\:A^{\boldsymbol{-}1}\:$$ is also orthogonal it leaves the inner product of two vectors invariant, so in \eqref{B-14} we could replace any inner product $$\:\left(A^{\boldsymbol{-}1}\mathbf{x}\right)\boldsymbol{\cdot}\left(A^{\boldsymbol{-}1}\mathbf{y}\right)\vphantom{\dfrac{a}{b}}\:$$ by $$\:\left(\mathbf{x}\boldsymbol{\cdot}\mathbf{y}\right)\vphantom{\dfrac{a}{b}}$$.

$$\boldsymbol{=\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!=}$$

• Just a friendly note that the only reason I haven't responded yet is that I want to give your answer due attention. I'll try to give it a thorough read in the next few days. Commented Apr 22, 2020 at 18:48
• Frobenius, I notice you've edited this answer 21 times, which is far more than normal, and can be disruptive when the question is repeatedly bumped to the top of the main page. Generally most posts should not be edited more than once or twice. Going forward, could you please refrain from editing this post unless you really need to? If you have small or optional changes to make, please save them up and batch them together with your next major and important edit. Commented Apr 30, 2020 at 22:02
• @Frobenius Thanks. I would suggest that you not wind up in a situation where you have to add new stuff day by day. Instead of editing new content into the answer every day, just keep a text file on your computer that you update each time, and then when you're done with your changes, make one big edit to the answer that applies all the changes you've accumulated. Commented Apr 30, 2020 at 22:09
• Accepted because I checked that the answer is correct in the symmetric case. Thanks! Commented Sep 5, 2021 at 18:06