Finding sum of an infinite series I  was trying to evaluate the following sum for each $x \in (0,\infty)$ and I am getting the following:
$\sum_{n=1}^{\infty} \frac{ (-1)^{n+1}}{n^2}(  x^{2n}+ \frac{1}{x^{2n}}-2)= 2(\ln x)^2. $
But in the proof I am starting with the function $f(x)= \sum_{n=1}^{\infty} \frac{x^{2n}}{n^2}.$
Then I differentiate f term by term and then integrate from $x$ to $1$ within its radius convergence to obtain the value of f in terms of integral. But when I put the value $\frac{1}{x}$ and $x \in (0,1)$ then we can't do term by term differentiation. Whereas if we put the same value for g($\frac{1}{x}$) as g(x), we obtain the same value of the sum as mentioned above. Is there any alternate precise way to prove this ? Any help or hint would be appreciated. Thanks in advance.

You are facing the definition of the polylogarithm function
$$\sum_{n=1}^{\infty} \frac{ (-1)^{n+1}}{n^2}\, x^{2n}= -\text{Li}_2\left(-x^2\right) $$
$$\sum_{n=1}^{\infty} \frac{ (-1)^{n+1}}{n^2}\, x^{-2n}=-\text{Li}_2\left(-\frac{1}{x^2}\right)$$
$$\sum_{n=1}^{\infty} \frac{ (-1)^{n+1}}{n^2}=\frac{\pi ^2}{12}$$ Now, remains to use
$$\text{Li}_2(-t)+\text{Li}_2\left(-\frac{1}{t}\right)=-\frac{1}{2} \log ^2(t)-\frac{\pi ^2}{6}$$ Then the sum is
$$\frac{1}{2} \log ^2(x^2)=2\log ^2(x)$$ as you found.
