I was requested to estimate
$$\int_{0}^{\frac{2}{5}} \ln(1+x^4)\,dx$$
with an error $\epsilon$ such that $\epsilon < \frac{1}{10^6}$ and using the series expansion of $f(x)=\ln(1+x^4)$. I am unsure of my result, and the validity of my procedure, and was wondering if someone could tell me if it's correct, or correct me if it's wrong. Thanks in advance for taking the time!
$i$) Firstly, notice that
$$\frac{d}{dx}f(x) = 4x^3\frac{1}{1+x^4} = \sum_{n=0}^{\infty}(-1)^n4x^{4n+3} $$
and therefore
$$f(x) = \ln(1+x^4) = \sum_{n=0}^{\infty} \frac{(-1)^n4x^{4n+4}}{4n+4} + C$$
and it is easy to see $C =0$, since $f(0) = 0$.
$ii)$ From $i$ it follows that $$\int_{0}^{\frac{2}{5}} \ln(1+x^4)\,dx = \int_{0}^{\frac{2}{5}} \sum_{n=0}^{\infty} \frac{(-1)^n4x^{4n+4}}{4n+4}\,dx$$
Now, since $\int \sum_{n=0}^{\infty} \frac{(-1)^n4x^{4n+4}}{4n+4} = \sum_{n=0}^{\infty} \frac{(-1)^n4x^{4n+5}}{(4n+4)(4n+5)} + C$, we have
$$\int_{0}^{\frac{2}{5}} \ln(1+x^4)\,dx = \int_{0}^{\frac{2}{5}} \sum_{n=0}^{\infty} \frac{(-1)^n4x^{4n+4}}{4n+4}\,dx$$
$$= \sum_{n=0}^{\infty} \frac{(-1)^n4(\frac{2}{5})^{4n+5}}{(4n+4)(4n+5)} - \sum_{n=0}^{\infty} \frac{(-1)^n4(0)^{4n+5}}{(4n+4)(4n+5)}$$ $$= \sum_{n=0}^{\infty} \frac{(-1)^n4(\frac{2}{5})^{4n+5}}{(4n+4)(4n+5)}$$
$iii)$ Therefore, the integral we are required to approximate is equal to an alternating series with $|a_n| = b_n = \frac{4(\frac{2}{5})^{4n+5}}{(4n+4)(4n+5)}$.
We know the series converges because it is a geometric series with $|r| = \frac{2}{5}$, and therefore $b_n \rightarrow 0$ when $n \rightarrow \infty$. Secondly, $b_{n+1} \leq b_n$ because
$$\frac{4(\frac{2}{5})^{4n+9}}{(4n+8)(4n+9)} \leq \frac{4(\frac{2}{5})^{4n+5}}{(4n+4)(4n+5)} \iff \frac{(\frac{2}{5})^4}{(4n + 8)(4n + 9)} \leq \frac{1}{(4n+4)(4n+5)}$$
Since the numerators are constant terms, the inequality is bound to be true for all $n \geq i$ for some $i \in \mathbb{N}$, since $(4n+4)(4n+5) \leq (4n+8)(4n+9)$ for all $n$. Therefore, the sequence is necessarily decreasing from some point onwards.
Because the sequence is decreasing and its limit is $0$, we know $|\epsilon| = |s - s_n| \leq |b_{n+1}|$. Using a calculator, we can see that $$|b_{n+1}| \leq \frac{1}{10^6}$$ is already satisfied for $n = 1$, and therefore $|\epsilon| < \frac{1}{10^6}$ for $n \geq 1$. Then, we have that
$$\int_{0}^{\frac{2}{5}} \ln(1+x^4)\,dx \approx \sum_{n = 0}^{1} \frac{(-1)^n4(\frac{2}{5})^{4n+5}}{(4n+4)(4n+5)} = \frac{4(\frac{2}{5})^4}{4 \times 5} - \frac{4(\frac{2}{5})^9}{9 \times 8} = 0.00510...$$
Indeed, WolframAlpha's calculator yields $$\int_{0}^{\frac{2}{5}} \ln(1+x^4)\,dx \approx 0.00203$$
so the approximation does not seem too bad. However, this could be mere chance.
\begin{align*} \log(1+x)&=x-{x^2\over 2}+{x^3\over 3}+...\\ \implies\log(1+x^4)&=x^4-{x^8\over 2}+{x^{12}\over 3}+...\\ \implies\int_0^{2/5}\log(1+x^4)dx&={x^5\over 5}-{x^9\over 18}+{x^{13}\over 39}+...+{x^{4n+1}\over {n(4n+1)}}+...|^{2/5}_0 \end{align*} Taking one term gives $0.002048$ the next term corrects this to $0.00203343644$ and another gives $0.00203360851$ ...