How find this $g(x)=f(x)f(1-x)$ maximum and minimum Question:
Let  $f: \mathbb{R}\to\mathbb{R}$ is a function such that $$f( \cot x ) = \cos 2x+\sin 2x $$ for all $0 < x < \pi$.
Define $$g(x) = f(x) f(1-x) , -1 \leq x \leq 1$$ Find the maximum and minimum values of $g$ on the closed interval $[-1, 1].$
My try: since 
$$\sin{2x}=\dfrac{2\tan{x}}{1+\tan^2{x}},\cos{2x}=\dfrac{1-\tan^2{x}}{1+\tan^2{x}}$$so
$$\sin{(2x)}+\cos{(2x)}=\dfrac{1-\tan^2{x}+2\tan{x}}{1+\tan^2{x}}$$
so
$$f(x)=\dfrac{x^2+2x-1}{x^2+1}$$
then
$$g(x)=f(x)f(1-x)=\dfrac{x^2+2x-1}{x^2+1}\cdot\dfrac{(1-x)^2+2(1-x)-1}{(1-x)^2+1},-1\le x\le 1$$
Then I can't.Thank you for your help
 A: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert #1 \right\vert}%
 \newcommand{\yy}{\Longleftrightarrow}$
$\ds{{\rm f}\pars{x} = {x^{2} + 2x - 1 \over x^{2} + 1}\,,\quad
{\rm f}\pars{1 - x} = {x^{2} - 2x + 1 + 2 - 2x - 1 \over x^{2} -2x + 2}
={x^{2} - 4x + 2 \over x^{2} - 2x + 2}}$
$\large\tt Hint:$
$$
0 = {\rm g}'\pars{x}
=
{\rm f}'\pars{x}{\rm f}\pars{1 - x} - {\rm f}\pars{x}{\rm f}'\pars{1 - x}
\quad\imp\quad
{{\rm f}'\pars{x} \over {\rm f}\pars{x}}
=
{{\rm f}'\pars{1 - x} \over {\rm f}\pars{1 - x}}
$$
$$
\totald{\ln\pars{{\rm f}\pars{x}}}{x} + \totald{\ln\pars{{\rm f}\pars{1 - x}}}{x} = 0
$$
$$
0={2x + 2 \over x^{2} + 2x - 1} - {2x \over x^{2} + 1}
+
{2x - 4 \over x^{2} - 4x + 2} - {2x - 2\over x^{2} - 2x + 2}
$$
A: let $a=x,b=1-x，f\left(a\right)=1+\dfrac{2a-2}{a^2+1},g\left(x\right)=f\left(a\right)*f\left(b\right)=1+\dfrac{\left(2a-2\right)\left(2b-2\right)}{\left(1+a^2\right)\left(1+b^2\right)}+\dfrac{\left(2a-2\right)}{\left(1+a^2\right)}+\dfrac{\left(2b-2\right)}{\left(1+b^2\right)}=1+\dfrac{4-4\left(a+b\right)+4ab}{a^2b^2+a^2+b^2+1}+\dfrac{-2-2b^2-2-2a^2+2\left(a+b\right)+2ab\left(a+b\right)}{a^2b^2+a^2+b^2+1}=1+\dfrac{8ab-4}{\left(ab\right)^2-2ab+3}=1+\dfrac{4-8\left(1-ab\right)}{\left(1-ab\right)^2+2}=1+4\times\dfrac{1-2u}{u^2+1},u=1-ab=1-a+a^2> 0$
$h\left(u\right)=\dfrac{1-2u}{u^2+1},3\ge u>0 $
$h'\left(u\right)=\dfrac{u^2-u-1}{\left(u^2+1\right)^2}=0, u=\dfrac{1+\sqrt{5}}{2}$, is min,
max is $u$ get min which is $u=\dfrac{3}{4}$
edit: there is more simple method to find max and min of $h\left(u\right)$
$u\ge \dfrac{3}{4} \implies 2u-1 \ge 0, t=2u-1,h\left(u\right)=-\dfrac{4t}{t^2+2t+5}=-\dfrac{4}{t+\dfrac{5}{t}+2} $
let $q\left(t\right)=t+\dfrac{5}{t}, \dfrac{1}{2}\le t \le 5 , q\left(t\right) \ge 2\sqrt{5}$ when $t=\sqrt{5}$ ,it is min.
for max, we only need to check two bounds: $q\left(\dfrac{1}{2}\right)=10\dfrac{1}{2},q\left(5\right)=6$, so max is $q=10\dfrac{1}{2}, t=\dfrac{1}{2}$.
now these are all high school methods.
