I am trying to solve the following question;
Given a polynomial $f\in \mathbb{C}[x_{1},x_{2},\ldots,x_{n}]$, find the largest subgroup $\Gamma\le GL(\mathbb{C}^{n})$ such that $f\in \mathbb{C}[x_{1},x_{2},\ldots,x_{n}]^{\Gamma}$. Here $f\in \mathbb{C}[x_{1},x_{2},\ldots,x_{n}]^{\Gamma}$ denotes the invariant ring of $\Gamma$, i.e the set of all $\sigma\in GL(\mathbb{C}^{n})$ such that $f\circ\sigma=f$.
I have tried simple cases (quadratic and linear polynomials) by just taking a polynomial say $f=x^{2}+y^{2}$ and a generic matrix $A=\begin{bmatrix}p & q\\r & s\end{bmatrix}$, then computing $$A \begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}ax+by\\cx+dy\end{bmatrix},$$which I then plug into $f$ to get $$(px+qy)^{2}+(rx+sy)^{2}=p^2 x^2+r^2 x^2+2 p q x y+2 r s x y+q^2 y^2+s^2 y^2.$$ Then I equate coefficients to get a system of equations $$\{p^2+r^2-1, 2pq+2rs, q^2+s^2-1\}$$ which I solve using Groebner bases.
This method works for these basic cases, however seems very basic and without much theory behind it. I was wondering if there was a more efficient and/or elegant way to compute these groups given a generic polynomial?
Background wise, I am familiar with all content from the book https://www.springer.com/us/book/9783211774168, which covers classical invariant theory (Hilbert Series, Molien Series, Noethers bound, etc.).
Any help is appreciated.