Method to find the unique substitution which interchanges the original polynomials in this problem If $f$ is an $R$ to $R$ function such that $f(x^2+x+3)+2f(x^2-3x+5)=6x^2-10x+17$ find f(x)

One way would be to assume its a polynomial equation and solve for it . Otherwise              : Notice that if we replace $x$ by $1-x$ then $f(x^2-3x+5)+2f(x^2+x+3)=6x^2-2x+13$
Now we just need to solve the system of equations:
$\left\{\begin{matrix}
f(x^2+x+3)+2f(x^2-3x+5)=6x^2-10x+17\\ 
f(x^2-3x+5)+2f(x^2+x+3)=6x^2-2x+13
\end{matrix}\right.$
Solving that system of equations gives $\left\{\begin{matrix}
f(x^2+x+3)=2x^2+2x+3\\ 
f(x^2-3x+5)=2x^2-6x+7
\end{matrix}\right.$
This gives $f(x)=2x-3$.


*

*My question is how to deduce /calculate and arrive at that there is a way (here its $x \rightarrow 1-x$ ) such that two polynomial inside the function as input can be interchanged into each other via unique substitution ? And what are these pair of polynomials called as ? They seem to be very special in the sense everything about their nature is deducable from its other one .

 A: That's not hard.
Let $Q_1(x) = x^2 + x + 3$ and let $Q_2(x) = x^2 - 3x + 5$, then we want to find  a function $g(x)$ s.t.
\begin{align*}
Q_1(g(t)) &\equiv Q_2(t) \\
Q_2(g(t)) &\equiv Q_1(t)
\end{align*}
Then by these equations we get $Q_2\big( g \circ g(t) \big) \equiv Q_2(t)$ and $Q_1\big( g \circ g(t) \big) \equiv Q_1(t)$.
Now for any quadratic equation $Q(x) \equiv ax^2 + bx + c$, $Q(\alpha) = Q(\beta) \Rightarrow (\alpha = \beta) \lor (\alpha + \beta = -\frac{b}{a})$.
So we get $\big((g \circ g(t) = t) \lor (g \circ g(t) + t = 3) \big) \land \big((g \circ g(t) = t) \lor (g \circ g(t) + t = -1) \big) \Rightarrow g \circ g(t) = t$.
[Note that if either of $Q_1$ and $Q_2$ are odd degree polynomials, (or infact any strictly monotone functions), then we get here directly].
Now a function $g(x)$ which satisfies $(\forall x) \: g \circ g(x) = x$ is called an involution. A few examples of involutions are $ K-x$ for any $K \in \mathbb{R}$, $\frac{1}{x}$ and many more. More generally a function which satisfies $(\forall x) \:f \circ f ... \text{b times} (x) = x$ is said to be periodic with period $b$ (So an involution is just a periodic function with period $2$).
Now if we restrict ourselves to polynomial involutions, since $Q_1$ and $Q_2$ have degree 2, we need $g(x)$ to have degree exactly $1$. And we can easily prove the following lemmas:
Lemma. If $f$ is an involution and a degree 1 polynomial, then $f(x) = x$ or $f(x) = K - x$ for any $K \in \mathbb{R}$.
Lemma 2. There are no polynomial involutions of degree $>1$.
We can combine this to get:
Result: The only polynomial involutions are $f(x) = K - x$ for any $K \in \mathbb{R}$ and $f(x) = x$.
So a good guess will be to find $K$ for which the original 2 equations are satisfied.

GENERALIZATION TO ALL POLYNOMIALS
Defn. Two polynomials $P_1(x)$ and $P_2(x)$ are interchangeable if there exists $g(x)$ s.t.
\begin{align*}
P_1(g(t)) &\equiv P_2(t) \\
P_2(g(t)) &\equiv P_1(t)
\end{align*}
(We can show that $g(x)$ must also be a polynomial.) Then we can show the following sufficiency results:
Theorem 1. Suppose $P_1(x)$ and $P_2(x)$ are interchangeable. Then:
$$\text{deg }(P_1(x)) = \text{deg }(P_2(x))$$
Theorem 2.1. Suppose $P_1(x)$ and $P_2(x)$ are odd degree polynomials with same degree and $P_1 \not\equiv P_2$. Then $P_1(x)$ and $P_2(x)$ are interchangeable iff $\exists K \in \mathbb{R}$ s.t.
\begin{align*}
P_1(K - t) &\equiv P_2(t) \\
P_2(K - t) &\equiv P_1(t)
\end{align*}
Theorem 2.2. Suppose $P_1(x)$ and $P_2(x)$ are even degree polynomials with same degree, $P_1 \not\equiv P_2$ and the system of equations in 2 variables given by $\frac{P_1(x) - P_1(y)}{x-y} = 0 = \frac{P_2(x) - P_2(y)}{x-y}$ for $x \neq y$ has no solution. Then $P_1(x)$ and $P_2(x)$ are interchangeable iff $\exists K \in \mathbb{R}$ s.t.
\begin{align*}
P_1(K - t) &\equiv P_2(t) \\
P_2(K - t) &\equiv P_1(t)
\end{align*}
A: You are looking for a substitution $x \mapsto g(x)$ such that $\,g^2(x) + g(x) + 3 = x^2 - 3x + 5\,$ $\,\iff g(x)\left(g(x) + 1\right) = x^2-3x+2=(x-2)(x-1)=(1-x)(2-x)\,$. The factors on both sides differ by $\,1\,$, so the natural substitutions to try are $\,g(x)=x-2\,$ or $\,g(x) = 1-x\,$. They both work, but only $\,g(x) = 1-x\,$ also satisfies $\,g^2(x)- 3 g(x) + 5 = x^2+x+3\,$ which is required for the reverse substitution to work.
