Find the first four non zero terms of the Taylor series for $f(x) = \int_0^x \frac{1-\cos(t)}{t}dt$
$$f(x) = \int_0^x \frac{1-\cos(t)}{t}dt = \int_0^x \frac{1- (1 + \sum_{n=1}^{\infty}\frac{(-1)^n t^{2n}}{(2n)!})}{t} dt = \int_0^x\sum_{n=1}^{\infty}\frac{(-1)^{n+1}t^{2n -1}}{(2n)!} dt=\sum_{n=1}^{\infty}\int_0^x\frac{(-1)^{n+1}t^{2n -1}}{(2n)!} dt = \sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{(2n)!}\int_0^x t^{2n-1}dt =\sum_{n=1}^{\infty}\frac{(-1)^{n+1}x^{2n}}{(2n)! \cdot (2n)} = \frac{x^2}{4} - \frac{x^4}{4\cdot4!} + \frac{x^6}{6\cdot 6!} - \frac{x^8}{8\cdot 8!} +\dots$$
So the first four terms are:
$\frac{x^2}{4}$; $\;- \frac{x^4}{4\cdot4!}$;$\; \frac{x^6}{6\cdot 6!}$;$\;- \frac{x^8}{8\cdot 8!}$
Is this correct?
It is correct, and a quite fast way of solving it. Another (not as optimal) way of doing it is by differentiating the function and using the fundamental theorem of calculus.
$$f(x) = \int_0^x \frac{1-\cos(t)}{t}dt \Rightarrow f'(x) = \frac{1-\cos(x)}{x}.$$
Evaluating the term above at $x=0$ yields zero, and therefore the first order term is zero.
$$f''(x) = \frac{\sin(x)}{x} - \frac{1-\cos(x)}{x^2}.$$
At $x=0$ the first summand yields $1$ and the second yields $1/2$. This gives $\frac{f''(0)}{2} = \frac{1}{4}.$
I proceeded with the differentiations in Mathematica and obtained exactly what you have,
$$\frac{x^2}{4};-\frac{x^4}{4\cdot 4!};\frac{x^6}{6\cdot 6!};\frac{x^8}{8\cdot 8!}.$$
Congratulations for the quick solution!