How do I transform the integral of $cos(r^3)$ evaluated from $0$ to $x$ into a power series?
I've tried to compute $cos(r)$ into a power series first and then evaluating its antiderivative, but the resulting power series looked nothing like the original integrated function after graphing them.
Can someone show me how to transform this trig integral into a power series?
$$ \cos(r) = \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} r^{2n} \text{,} $$ so $$ \cos(r^3) = \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} r^{6n} \text{.} $$ This power series has infinite radius of convergence, so the following series does also. \begin{align*} \int_0^x \; \cos(r^3) \,\mathrm{d}r &= \int_0^x \; \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} r^{6n} \,\mathrm{d}r \\ &= \sum_{n=0}^\infty \int_0^x \; \frac{(-1)^n}{(2n)!} r^{6n} \,\mathrm{d}r \\ &= \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} \left. \frac{r^{6n+1}}{6n+1} \right|_0^x \\ &= \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} \left( \frac{x^{6n+1}}{6n+1} - \frac{0^{6n+1}}{6n+1} \right) \\ &= \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} \frac{x^{6n+1}}{6n+1} \text{.} \end{align*}
You don't post your mismatched plots nor explain what difference there was... Plotting the integral in blue and the series in yellow, they exactly overlap. (I displaced the integral's trace microscopically so it would be slightly visible behind the series's trace.