How do we evaluate $\sum_{k=1}^{\infty} \frac{1}{3k-1}-\frac{1}{3k}$ We have to evaulate $$\sum_{k=1}^{\infty} \frac{1}{3k-1}-\frac{1}{3k}$$
I have tried to expand it to see some kind of pattern, but there seems to be no obvious one! Then I tried to just mindlessly integrate and after solving the integral $\int_1^{\infty} \frac{1}{3k-1}-\frac{1}{3k} dk$ the answer came to be $\frac{1}{3}\log(\frac{3}{2})$ which contrasts the answer from wolfram alpha by a significant margin which is $\frac{1}{18}(9\log3-\sqrt{3}\pi)$. 
I have found problems of similar kind on this site but I am not really able to understand them, specifically, how did this particular sum got converted into a gamma function (they don't seem to be related on the surface). 
I have some idea about gamma and beta function but please try to be as detailed as possible (at least for the conversion of the sum into integral part) with your solutions.
 A: I think @ThomasAndrews' comment is worthy of becoming an answer in its own right.

We obtain
\begin{align*}
\color{blue}{\sum_{k=1}^{\infty}}\color{blue}{\left(\frac{1}{3k-1}-\frac{1}{3k}\right)}&=\sum_{k=1}^{\infty}\int_{0}^1\left(x^{3k-2}-x^{3k-1}\right)dx\\
&=\int_0^1\sum_{k=0}^{\infty}\left(x^{3k+1}-x^{3k+2}\right)dx\tag{1.1}\\
&=\int_{0}^1\left(\frac{x}{1-x^3}-\frac{x^2}{1-x^3}\right)dx\tag{1.2}\\
&\,\,\color{blue}{=\int_{0}^1\frac{x}{1+x+x^2}dx}\tag{1.3}
\end{align*}

Comment:

*

*In (1.1) we exchange sum and integral and shift the index of the sum to start with $k=0$.


*In (1.2) we apply the geometric series expansion.


*In (1.3) we use $1-x^3=(1-x)\left(1+x+x^2\right)$.
We derive from (1.3) by elementary transformations
\begin{align*}
\color{blue}{I:=\int_{0}^1}&\color{blue}{\frac{x}{1+x+x^2}dx}\\
&=\int_{0}^1\frac{2x+1}{1+x+x^2}dx-\int_{0}^1\frac{1+x}{1+x+x^2}dx\\
&=\ln\left(1+x+x^2\right)\Big|_0^1-I-\int_0^1\frac{dx}{1+x+x^2}\\
&=\ln (3)-I-\int_{0}^1\frac{dx}{\frac{3}{4}+\left(x+\frac{1}{2}\right)^2}\\
&=\ln (3)-I-\frac{4}{3}\int_{0}^1\frac{dx}{1+\left(\frac{2}{\sqrt{3}}\left(x+\frac{1}{2}\right)\right)^2}\\
&=\ln (3)-I-\frac{2\sqrt{3}}{3}\int_{1/\sqrt{3}}^{\sqrt{3}}\frac{du}{1+u^2}\tag{2.1}\\
&=\ln (3)-I-\frac{2\sqrt{3}}{3}\left(\arctan\left(\sqrt{3}\right)-\arctan\left(\frac{1}{\sqrt{3}}\right)\right)\\
&=\ln (3)-I-\frac{2\sqrt{3}}{3}\left(\frac{\pi}{3}-\frac{\pi}{6}\right)\\
&\,\,\color{blue}{=\ln (3)-I-\frac{\pi}{9}\sqrt{3}}\tag{2.2}
\end{align*}
Comment:

*

*In (2.1) we substitute
$
u=\frac{2}{\sqrt{3}}\left(x+\frac{1}{2}\right), 
du=\frac{2}{\sqrt{3}}dx
$
and set the limits of the integral accordingly.


Putting (1.3) and (2.2) together we finally get
\begin{align*}
\color{blue}{\sum_{k=1}^{\infty}}&\color{blue}{\left(\frac{1}{3k-1}-\frac{1}{3k}\right)
=\frac{1}{2}\ln (3)-\frac{\pi}{18}\sqrt{3}}
\end{align*}

A: Here is an idea using the Digamma Function.
Let the given sum equal $S$. Consider the following manipulation:
$$
\eqalign{
S&=\displaystyle\sum_{k\in\mathbb{N}} \left(\frac{1}{3k-1}-\frac{1}{3k}\right) \cr
&= -\dfrac{1}{3}\left(\sum_{k\in\mathbb{N}}\left(\frac{1}{k}-\frac{1}{k-\frac{1}{3}}\right) - \gamma + \gamma\right) \cr 
&= -\dfrac{1}{3}\left(\psi\left(-\frac{1}{3}+1\right)+\gamma\right), \cr
}
$$
where we used the formula
$$\psi(s+1) = \sum_{k\in\mathbb{N}}\left(\frac{1}{k}-\frac{1}{k+s}\right) - \gamma.$$
One of Gauss's formulas relates values of the Digamma function for $r,m \in \mathbb{Z}^+$ such that $r < m$ to some elementary functions. Specifically,
$$\psi\left(\dfrac{r}{m}\right) = -\gamma - \ln(2m) -\frac{\pi}{2}\cot\left(\frac{r\pi}{m}\right)+2\sum_{k=1}^{\lfloor{\frac{m-1}{2}\rfloor}}\cos\left(\frac{2\pi kr}{m}\right)\ln\left(\sin\left(\frac{\pi k}{m}\right)\right).$$
Rewriting $\psi\left(-\frac{1}{3}-1\right)$ as $\psi\left(\frac{2}{3}\right)$, we get
$$\psi\left(\frac{2}{3}\right) = -\gamma - \ln(2 \cdot 3) -\frac{\pi}{2}\cot\left(\frac{2\pi}{3}\right)+2\sum_{k=1}^{\lfloor{\frac{3-1}{2}\rfloor}}\cos\left(\frac{2\pi k2}{3}\right)\ln\left(\sin\left(\frac{\pi k}{3}\right)\right),$$
which simplifies down to
$$-\gamma -\ln\left(6\right)+\frac{\pi\sqrt{3}}{6}-\ln\left(\frac{\sqrt{3}}{2}\right).$$
Plugging it back into $S$ and simplifying, we ultimately get
$$S = \ln\left(\sqrt{3}\right)-\frac{\pi}{6\sqrt{3}}.$$
A: Let
$$f(x)=\sum_{k=1}^{\infty}( \frac{1}{3k-1}-\frac{1}{3k})x^{3k}.$$
Then
$$ f’(x)=\sum_{k=1}^{\infty} \frac{1}{3k-1}x^{3k-1}, f’’(x)=\sum_{k=1}^{\infty}x^{3k-2}=\frac{x}{1-x^3}$$
and hence
\begin{eqnarray}
f(1)&=&\int_0^1\int_0^x\frac{y}{1-y^3}dydx=\int_0^1\int_y^1\frac{y}{1-y^3}dxdy\\
&=&\int_0^1\frac{(1-y)y}{1-y^3}dy=\int_0^1\frac{y}{y^2+y+1}dy\\
&=&\int_0^1\frac{(y+\frac12)-\frac12}{(y+\frac12)^2+(\frac{\sqrt3}2)^2}dy\\
&=&\frac12\ln((y+\frac12)^2+(\frac{\sqrt3}2)^2)-\sqrt3\arctan(\frac{2x+1}{\sqrt3})\bigg|_0^1\\
&=&\frac12\ln3-\frac{\sqrt3\pi}{18}.
\end{eqnarray}
