Find $\sum_{k=0}^n \frac{1}{(3k+1)(3k-1)}$ I'm having problem solving this.
I had a look at
Showing $ \sum_{n=0}^{\infty} \frac{1}{(3n+1)(3n+2)}=\frac{\pi}{3\sqrt{3}}$ , but it didn't really helped.
 A: The finite sum
$$\sum_{k=0}^n\frac{1}{(3k+1)(3k-1)}$$
Can be expressed in terms of the digamma function,
$$=\frac{1}{6}\left(\psi^{(0)}(n+2/3)-\psi^{(0)}(n+4/3)+\psi^{(0)}(1/3)-\psi^{(0)}(-1/3)\right)$$
Where
$$\psi^{(n)}(z):=(-1)^{n+1}n!\sum_{k=0}^\infty\frac{1}{(z+k)^{n+1}}$$
This can be obtained by splitting the denominator using partial fractions.
The digamma function has the known special values
$$\psi^{(0)}(1/3)=-\gamma-\frac{\pi}{2\sqrt{3}}-\frac{3\log 3}{2} \\ \psi^{(0)}(-1/3)=3-\gamma+\frac{\pi}{2\sqrt 3}-\frac{3\log 3}{2}$$
These can be deduced from the reflection and addition properties of the polygamma.
As for the limit
$$\lim_{n\to\infty} \psi^{(0)}(n+2/3)-\psi^{(0)}(n+4/3)$$
We can use the asymptotic expansion
$$\psi^{(0)}(z)\asymp \ln z \\ \text{as}~z\to\infty$$
To conclude
$$\lim_{n\to\infty} \psi^{(0)}(n+2/3)-\psi^{(0)}(n+4/3)=\lim_{n\to\infty}\ln(n+2/3)-\ln(n+4/3) \\ =\lim_{n\to\infty}\ln\left(\frac{n+2/3}{n+4/3}\right)=\ln(1)=0$$
Hence,
$$\sum_{k=0}^\infty\frac{1}{(3k+1)(3k-1)}=\lim_{n\to\infty}\frac{1}{6}\left(\psi^{(0)}(n+2/3)-\psi^{(0)}(n+4/3)+\psi^{(0)}(1/3)-\psi^{(0)}(-1/3)\right) \\ =\frac{1}{6}\left(-\gamma-\frac{\pi}{2\sqrt{3}}-\frac{3\log 3}{2}-3+\gamma-\frac{\pi}{2\sqrt 3}+\frac{3\log 3}{2}\right) \\ =\frac{-1}{2}-\frac{\pi}{6\sqrt 3}\approx -0.802299894...$$

If this answer seems too "artificial" to you, I rebut that these kind of problems are exactly what special functions such as $\psi^{(n)}$ are designed for.

Edit: A reasonably painless way of getting the desired result.
We can show that
$$\psi^{(0)}(-z)-\psi^{(0)}(z)=\frac{1}{z}+\pi\cot(\pi z)$$
Quite easily from the recurrence relation
$$\psi^{(m)}(z+1)=\psi^{(m)}(z)+\frac{(-1)^mm!}{z^{m+1}}$$
And the reflection identity
$$\psi^{(m)}(1-z)-\psi^{(m)}(z)=\pi\frac{\mathrm d^m}{\mathrm dz^m}\cot(\pi z)$$
I have posted a proof of this reflection identity somewhere on this site, but I can't find it.
You can use these formulae (exercise) to show
$$\psi^{(0)}(1/3)-\psi^{(0)}(-1/3)=-3-\pi\cot(\pi/3)=-3-\frac{\pi}{\sqrt{3}}$$
A: We shall use a standard approach that applies contour integration.  We will integrate the function $f(z)=\frac{\cot(\pi z)}{(3z+1)(3z-1)}$ over the closed contour $C_N$ on which $|z|=N+1/2$, $N\in \mathbb{N_{\ge0}}$.
We will make use of the facts that $|\cot(\pi z)|$ is bounded on $|z|=N+1/2$ and that $f$ has simple poles at $z=\pm1/3$ and $z=n$, for $n\in \mathbb{Z}$ with $|n|<N$.  Proceeding we have
$$\begin{align}
\oint_{C_N}f(z)\,dz&=\frac1{2\pi  i}\oint_{|z|=N+1/2} \frac{\cot(\pi z)}{(3z+1)(3z-1)}\,dz\tag1\\\\
&= \sum_{n=-N}^N \text{Res}\left(\frac{\cot(\pi z)}{(3z+1)(3z-1)},z=n\right)\\\\
&+ \text{Res}\left(\frac{\cot(\pi z)}{(3z+1)(3z-1)},z=1/3\right)\\\\ 
&+ \text{Res}\left(\frac{\cot(\pi z)}{(3z+1)(3z-1)},z=-1/3\right)\\\\ 
&=\sum_{n=-N}^N \frac1{(3n+1)(3n-1)}+\frac{\pi}{3\sqrt3}\\\\
&=2\sum_{n=0}^N \frac1{(3n+1)(3n-1)}+1+\frac{\pi}{3\sqrt3}
\end{align}$$
Letting $N\to\infty$, the contour integral in $(1)$ goes to $0$ and we find that
$$\sum_{n=0}^\infty \frac1{(3n+1)(3n-1)}=-\frac12-\frac{\pi\sqrt3}{18}$$
And we are done!
