<s>[INST] Show that $\int_{-\infty}^{\infty} \frac{\cos (\theta) e^{\theta y}}{2 \cosh(\pi y/2)} y dy=\tan (\theta)$. I'm not a hardcore mathematician. I have exhausted all integration trick I learned in calculus including change of variables, integration by parts. That cosh on denominator is just very much in the way. How one should approach an integral like this. 
 [/INST] Here is a real method.
Let
$$I = \int_{-\infty}^\infty \frac{\cos \theta \, e^{\theta y} \, y}{2 \cosh \left (\frac{\pi y}{2} \right )} \, dy,$$
where $\theta \in (-\pi/2, \pi/2)$.
Now
$$I = \frac{\cos \theta}{2} \int_{-\infty}^0 \frac{y e^{\theta y}}{\cosh \left (\frac{\pi y}{2} \right )} \, dy + \frac{\cos \theta}{2} \int_0^\infty \frac{y e^{\theta y}}{\cosh \left (\frac{\pi y}{2} \right )} \, dy = I_1 + I_2.$$
In the first of the integrals, enforcing a substitution of $y \mapsto -y$ gives
\begin{align}
I_1 &= -\frac{\cos \theta}{2} \int_0^\infty \frac{y e^{-\theta y}}{\cosh \left (\frac{\pi y}{2} \right )} \, dy\\
&= -\cos \theta \int_0^\infty \frac{y e^{-\theta y}}{e^{\frac{\pi y}{2}} + e^{-\frac{\pi y}{2}}} \, dy \tag1\\
&= -\cos \theta \int_0^\infty \frac{y e^{-\theta y - \pi y/2}}{1 + e^{-\pi y}} \, dy\\
&= -\cos \theta \sum_{n = 0}^\infty (-1)^n \int_0^\infty y e^{-(n \pi + \pi/2 + \theta)} \, dy \tag2\\
&= -\cos \theta \sum_{n = 0}^\infty \frac{(-1)^n}{(n \pi + \pi/2 + \theta)^2} \tag3\\
&= -\frac{\cos \theta}{\pi^2} \sum_{n = 0}^\infty \frac{(-1)^n}{(n + \frac{1}{2} + \frac{\theta}{\pi})^2}\\
&= -\frac{\cos \theta}{\pi^2} \sum_{\substack{n = 0\\n \in \text{even}}}^\infty \frac{1}{\left (n + \frac{1}{2} + \frac{\theta}{\pi} \right )^2} - \frac{\cos \theta}{\pi^2} \sum_{\substack{n = 0\\n \in \text{odd}}}^\infty \frac{1}{\left (n + \frac{1}{2} + \frac{\theta}{\pi} \right )^2}\\ 
&= -\frac{\cos \theta}{4 \pi^2} \sum_{n = 0}^\infty \frac{1}{\left (n + \frac{1}{4} + \frac{\theta}{2 \pi} \right )^2} - \frac{\cos \theta}{4 \pi^2} \sum_{n = 0}^\infty \frac{1}{\left (n + \frac{3}{4} + \frac{\theta}{2 \pi} \right )^2} \tag4\\
&= -\frac{\cos \theta}{4 \pi^2} \left [\psi^{(1)} \left (\frac{\theta}{2 \pi} + \frac{1}{4} \right ) - \psi^{(1)} \left (\frac{\theta}{2 \pi} + \frac{3}{4} \right ) \right ] \tag5 
\end{align}
In a similar manner, for the second of the integrals it can be shown that
$$I_2 = \frac{\cos \theta}{4 \pi^2} \left [\psi^{(1)} \left (\frac{1}{4} - \frac{\theta}{2 \pi} \right ) - \psi^{(1)} \left (\frac{3}{4} - \frac{\theta}{2 \pi} \right ) \right ].$$
Thus
\begin{align}
I &= -\frac{\cos \theta}{4 \pi^2} \left [\psi^{(1)} \left [1 - \left (\frac{3}{4} - \frac{\theta}{2 \pi} \right ) \right ] + \psi^{(1)} \left (\frac{3}{4} - \frac{\theta}{2 \pi} \right ) \right ]\\
& \qquad \quad + \frac{\cos \theta}{4 \pi^2} \left [\psi^{(1)} \left [1 - \left (\frac{1}{4} - \frac{\theta}{2 \pi} \right ) \right ] + \psi^{(1)} \left (\frac{1}{4} - \frac{\theta}{2 \pi} \right ) \right ]\\
&= -\frac{\cos \theta}{4 \pi^2} \left [\pi^2 \operatorname{cosec}^2 \left (\frac{3 \pi}{4} - \frac{\theta}{2} \right ) - \pi^2 \operatorname{cosec}^2 \left (\frac{\pi}{4} - \frac{\theta}{2} \right ) \right ] \tag6\\
&= -\frac{\cos \theta}{4} \left (\frac{2}{\sin \theta + 1} + \frac{2}{\sin \theta - 1} \right )\\
&= -\frac{\cos \theta}{4} \cdot -\frac{4 \sin \theta}{\cos^2 \theta},
\end{align}
or finally
$$\int_{-\infty}^\infty \frac{\cos \theta \, e^{\theta y} \, y}{2 \cosh \left (\frac{\pi y}{2} \right )} \, dy = \tan \theta,$$
as required.

Explanation
(1) Using $\cosh x = (e^x + e^{-x})/2$.
(2) Geometric expansion.
(3) Integration by parts twice.
(4) Shifting of the indices. Here $n \mapsto 2n$ for $n$ even and $n \mapsto 2n + 1$ for $n$ odd.
(5) Using the series representation for the polygamma function.
(6) Using the reflexion relation for the trigamma function.
</s>