This is Exercise 6.7.7 from Abbott's Understanding analysis. For context, the section is about the Weierstrass approximation theorem, but this is a step towards proving it, so we cannot use WAT to prove this result. The exercise reads:
a) Use the fact that $\lvert a \rvert = \sqrt{a^{2}}$ to prove that, given $\epsilon > 0$, there exists a polynomial $q(x)$ satisfying $\lvert \lvert x \rvert - q(x) \rvert < \epsilon$ for all $x \in [-1,1]$.
b) Generalize this conclusion to an arbitrary interval $[a,b]$.
a) Throughout the section, Abbott motivates the approximation using the Taylor series of $\sqrt{1-x}$. In fact, in a previous exercise, I managed to prove that the Taylor series of $\sqrt{1-x}$ converge in $[-1,1]$ (link to the MSE I used for support).
My idea to prove this result is based on the manipulation of series. In particular, we can start with the Taylor series of $\sqrt{1-x} = \sum_{n=0}^{\infty}a_{n}x^{n}$, and modify the series to reach $\sqrt{x^{2}}$ on the left hand side of the equation, as suggested by the exercise.
$ \begin{align} \sqrt{1-x} &= \sum_{n=0}^{\infty}a_{n}x^{n} \\ \sqrt{1+x^{2}} &= \sum_{n=0}^{\infty}a_{n}(-1)^{n}x^{2n} \quad \text{substituting} \ x \ \text{for} \ -x^{2}. \\ \sqrt{x^{2}} &= \sum_{n=0}^{\infty}a_{n}(-1)^{n}(x^{2n}+1) \quad \text{centering x on the left hand side to}\ 0. \end{align} $
I am particularly unsure about the last step because I believe this should change the convergence of the series.
b) I am unsure of how to tackle this question, as from the way I proved the convergence of the Taylor series of $\sqrt{1-x}$, it was necessary that $x \in [-1,1]$.
I would appreciate it if someone could tell me whether what I did in a) is correct, or else hint me/give me a valid proof of it. Also, hints or solutions for b) are appreciated.
Edit 30/Mar/2022
Using @RobPratt suggestion, I would like to supplement his answer with part b) of the exercise.
We start with
\begin{align} \sqrt{x^{2}} &= \sum_{n=0}^{\infty} a_{n}(1-x^{2})^{n} \quad \text{for}\ x \in [-\sqrt{2}, \sqrt{2}] \\ \sqrt{\sqrt{2}x^{2}} &= \sum_{n=0}^{\infty} a_{n} \left(1-\sqrt{2}x^{2}\right)^{n} \quad \text{for}\ x \in [-1, 1] \\ \sqrt{\frac{\sqrt{2}x^{2}}{c}} &= \sum_{n=0}^{\infty} a_{n} \left(1-\frac{\sqrt{2}x^{2}}{c}\right)^{n} \quad \text{for}\ x \in [-c, c],\ \text{where}\ c=\max\{a,b\}. \\ \end{align} Since $c=\max\{a,b\}$, we know that $[a,b] \subseteq [-c,c]$. Alternatively, if we want to approximate exactly in $[a,b]$, we have to make the following transformation $y:=\sqrt{2}x^{2}\rightarrow \frac{by}{2}+\frac{(a+b)((1-y)}{4}$. Starting from $[-1,1]$.