I have to find the range of the function $$f(x)=\frac{2}{x^n+x^{n-1}+...x^1+1+\frac{1}{x}+...+\frac{1}{x^{n-1}}+\frac{1}{x^n}}$$ I re wrote this as $$f(x)=\frac{2}{1+\sum\limits_{k=1}^n (x^k+\frac{1}{x^k})}$$ Differentiating the function as $$f'(x)=\frac{-2}{1+\sum\limits_{k=1}^n (x^k+\frac{1}{x^k})}\cdot \bigl[\sum\limits_{k=1}^n k (x^{k-1}-\frac{1}{x^{k+1}})\bigr]$$ I don't know how to proceed any further. I know that to find range of a function, we plot the function $f(x)$ by putting $f'(x)=0$, which solves for critical points of the function, and then we determine whether the function increases or decreases in various intervals. But in this problem I don't know how to solve for $f'(x)=0$. So I tried to plot at $x=0,\infty,-\infty$. $f(x)$ at $x=+\infty$. $$f(\infty)= \frac{2}{1+\sum\limits_{k=1}^n \infty^k +\sum\limits_{k=1}^n\frac{1}{\infty^k}}=\frac{2}{1+\infty+0}=0 $$ Similarly, for $x=0:$ $$f(0)=\frac{2}{1+ \sum\limits_{k=1}^n 0^k + \sum\limits_{k=1}^n \frac{1}{0^k}} = \frac{2}{1+0+\infty} = 0 $$ For $x=-\infty$, $$f(-\infty) = \frac{2}{1+\sum\limits_{k=1}^n (-\infty)^k +\sum\limits_{k=1}^n (\frac{1}{-\infty})^k}=\frac{2}{1-\infty-0} =0 $$
I checked the plot of $f(x)$ in Desmos for few values of $n:$
[$f(x), n=5$][1] [$f(x), n=6$][2] [$f(x), n=7$][3]
I realised the maximum value of $f(x)$ for $x\in \mathbf R^+$ is at $x=0$. So, $$f(1)= \frac{2}{1+\sum\limits_{k=1}^n 1^k +\sum\limits_{k=1}^n \frac{1}{1^k}} = \frac{2}{1+2n} $$ This is correct for the three graphs I plotted at $n=5,6,7$. For $x\in \mathbf R^-, f(x)$ is either maximum at 2 (for odd n) or minimum at -2 (for even n). Solving for $f(-1)$ $$f(-1) = \frac{2}{1+\sum\limits_{k=1}^n (-1)^k +\sum\limits_{k=1}^n\frac{1}{(-1)^k}} = \begin{cases} \frac{2}{1-1-1} = -2&\text{n = odd}\\ \frac{2}{1+0+0} =2&\text{n = even} \end{cases} $$
So,the graph can be plotted if I know that the critical points are 1,-1, i.e., when $f'(x)=0$. But, I can't solve for $f'(x)=0$, as I showed above. So, how to know that 1, -1 are the critical points without solving for $f'(x)$? Is it a mere guess or just some observation I can't see? [1]: https://i.stack.imgur.com/ukCfk.jpg [2]: https://i.stack.imgur.com/rEEgL.jpg [3]: https://i.stack.imgur.com/Ikpmq.jpg
For x>0: $x^k + \frac{1}{x^k} \ge 2$ when equality holds for x=1. So,
If x>0 : $0<f(x) = \frac{2}{1+\sum_{k=1}^n {\left(x^k + \frac{1}{x^k}\right)} } \le \frac{2}{1+2n}$, with equality holds at $x=1$.
For analysis of f(x) at x<0, one can us geometric series we can write function as $f(x) = \frac{2(x-1)x^{n}}{x^{2n+1}-1}$. Now we analyze $f(-x)$ at $x>0$.
$f(-x) = \frac{2(-x-1)(-x)^{n}}{-x^{2n+1}-1} ={(-1)}^n \frac{2(x+1)x^{n}}{x^{2n+1}+1} $.
Assume $g(x) = \frac{2(x+1)x^{n}}{x^{2n+1}+1},~x>0$. Now we just need to show that $0<g(x)\le2$ for $x>0$.
For $x>0$ it is obvious that $(x^{n+1}-1)(x^n-1)\ge0 \Rightarrow x^{2n+1}+1 \ge (x+1)x^{n}$ so $g(x)\le 2$.
Therefore, for n even we have $f(-x) = g(x)~~ x>0 \Rightarrow 0<f(x)\le2$ for $x<0$.
for n odd
$f(-x) = -g(x) ~~ x>0 \Rightarrow -2\le f(x)<0$.
Hence, the range of f is $[-2,\frac{2}{1+2n}]$ for n odd and $[0,2]$ for n even.