Suppose that $\arctan(x)=\sum_{n=0}^{\infty} \frac{(-1)^nx^{2n+1}}{2n+1}$ for all x $\in$ $[-1,1]$. Use the least number of terms to approximate the value of the integral $$\int_0^{1/2} \frac{x-\arctan(x)}{x^2} dx$$ with an error less than $10^{-5}$
I did was $$ \int_0^{1/2} \frac{x-\arctan(x)}{x^2} dx = \int_0^{1/2} \frac{1}{x} dx + \sum_{n=0}^\infty \frac{(-1)^{n+1}}{2n+1} \int_0^{1/2} {x^{2n-1}} dx $$
I feel that $\int_0^{1/2} \frac{1}{x} dx$ diverges
HINT
You cannot quite split up like that, but here is something you can do: $$ \arctan x \approx x - \frac{x^3}{3} + \frac{x^5}{5} \pm \ldots $$ Therefore, $$ \frac{x - \arctan x}{x^2} \approx \frac{x^3/3 - x^5/5 \pm \ldots}{x^2} = x/3 - x^3/5 \pm \ldots $$