TITLE: Confused about developing a Taylor series of a function that implicates an integral
QUESTION [7 upvotes]: There is a function that makes me confused:
$$f(x)=\int_{\frac{\pi}{2}}^x \frac{\cos(t)}{t-\frac{\pi}{2}}~dt$$
The question wants me to find its Taylor series centered in $a=π/2$ and I don't know how, I tried separating $\cos(t)$ of $\dfrac{1}{t-π/2}$ and make the MacLaurin series of $\cos(t)$, and then multiply the series by $\dfrac{1}{t-\frac{π}{2}}
~dt$ . 
But at the end, it doesn't end as a Taylor series centered in $π/2$, it's more like a MacLaurin series : I found 
$$\sum_{n=0}^{\infty} \frac{t^n}{n!\cdot (t-\frac{π}{2})}$$
Please could you help me with this series ? 
Thank you a lot !

REPLY [4 votes]: Note that
$$\cos t = -\sin\left(t-\frac{\pi}{2} \right) = \sum_{n=0}^\infty \frac{(-1)^{n+1}}{(2n+1)!}\left( t-\frac{\pi}{2}\right)^{2n+1}$$
Then by integration 
\begin{align}f(x) &= \int^{x}_{\pi/2}\frac{1}{t-\pi/2} \sum_{n=0}^\infty \frac{(-1)^{n+1}}{(2n+1)!}\left( t-\frac{\pi}{2}\right)^{2n+1}\,dt\\&= \sum_{n=0}^\infty \frac{(-1)^{n+1}}{(2n+1)!}\int^{x}_{\pi/2}\left( t-\frac{\pi}{2}\right)^{2n}\,dt
\\&= \sum_{n=0}^\infty \frac{(-1)^{n+1}}{(2n+1)!}\int^{x-\pi/2}_{0}t^{2n}\,dt
\\&= \sum_{n=0}^\infty \frac{(-1)^{n+1}}{(2n+1)(2n+1)!}\left(x-\frac{\pi}{2} \right)^{2n+1}
\end{align}