Intuitive explanation why "shadow operator" $\frac D{e^D-1}$ connects logarithms with trigonometric functions? Consider the operator $\frac D{e^D-1}$ which we will call "shadow":
$$\frac {D}{e^D-1}f(x)=\frac1{2 \pi }\int_{-\infty }^{+\infty } e^{-iwx}\frac{-iw}{e^{-i w}-1}\int_{-\infty }^{+\infty } e^{i t w} f(t) \, dt \, dw$$
The integrals here should be understood as Fourier transforms.
Now, intuitively, why the following?
$$\left.\frac {D_x}{e^{D_x}-1} \left[\frac1\pi\ln \left(\frac{x+1/2 +\frac{z}{\pi }}{x+1/2 -\frac{z}{\pi }}\right)\right]\right|_{x=0}=\tan z$$
There are other examples where shadow converts trigonometric functions into inverse trigonometric, logarithms to exponents, etc:
$$\left.\frac {D_x}{e^{D_x}-1} \left[\frac1{\pi }\ln \left(\frac{x+1-\frac{z}{\pi }}{x+\frac{z}{\pi }}\right)\right]\right|_{x=0}=\cot z$$
 A: This is basically a lightly transformed version of Euler's cotangent partial fraction expansion
$$ \pi \cot(\pi z) = \frac{1}{z} + \sum_{n=1}^\infty \frac{1}{z-n} + \frac{1}{z+n}$$
(the log derivative of his famous sine product formula $\frac{\sin \pi z}{\pi z} = \prod_{n=1}^\infty \big(1-\frac{z^2}{n^2}\big)$).  By telescoping series one can rewrite this as
$$ \pi \cot(\pi z) = \sum_{n=0}^\infty \frac{1}{z-n-1} + \frac{1}{z+n}.$$
By Taylor's theorem, $e^{nD_x}$ is the operation of translation by $n$, so formally by geometric series we have
$$ \left.\frac{1}{1-e^{D_x}} f\, \right|_{x=0} = \sum_{n=0}^\infty \left.e^{nD_x} f\right|_{x=0} = \sum_{n=0}^\infty f(n)$$
(which incidentally helps explain the Euler-Maclaurin formula) and so
$$ \pi \cot(\pi z) = \left.\frac{1}{1-e^{D_x}} \left(\frac{1}{z-x-1} + \frac{1}{z+x}\right) \right|_{x=0}$$
or equivalently
$$ \pi \cot(\pi z) = - \left.\frac{D_x}{1-e^{D_x}} \ln \frac{x+z}{x+1-z} \right|_{x=0}.$$
This gives your identities after some simple rearrangements (and replacing $z$ with either $z/\pi$ or $z/\pi + 1/2$).
The primary reason for Euler's partial fraction identity is that the poles and residues of the cotangent function are easily identified and computed.  The reason they can be collapsed into an expression involving the summation operator $\frac{1}{1-e^{D_x}}$ is that these poles and residues enjoy a translation invariance, which ultimately comes from the periodicity of the cotangent function.  I would imagine there are similar identities for the Weierstrass $\wp$ function, which is doubly periodic with very specific pole behavior.
A: The op $$T_x = \frac{D_x}{e^{D_x}-1} = e^{b.D_x},$$
where $(b.)^n = b_n$ are the Bernoulli numbers, is (mod signs) often referred to as the Todd operator (maybe originally given that name by Hirzebruch, who used it to construct his Todd characteristic class).
It has a discretizing (or derivational) property that can be expressed in the following  useful ways
$$f(x) = T_x T_x^{-1} f(x) = \frac{D}{e^D-1} \frac{e^D-1}{D}  f(x) =  T_x \int_{x}^{x+1} f(t) dt$$
$$ = e^{b.D} \;\int_{x}^{x+1} f(t) dt = \int_{b.+x}^{b.+x+1} f(t) dt =\int_{B.(x)}^{B.(x)+1} f(t) dt$$
$$ = F(B.(x)+1) - F(B.(x)) = F(B.(x+1)) - F(B.(x)) = D_x \; F(x),$$
where
$$B_n(x) = (b.+x)^n = \sum_{k=0}^n \binom{n}{k} \; b_k \; x^{n-k}$$
are the celebrated Appell Bernoulli polynomials, with the e.g.f. $e^{B.(x)t}= e^{(b.+x)t} = \frac{t}{e^t-1}e^{xt}$, and $F(x)$ is the indefinite integral/primitive  of $f(x)$. The last equality illustrates the derivational property of the Bernoulli polynomials and completely defines them.
This leads to
$$\sum_{k=0}^n f(x+k) = T \; \int_{x}^{x+n+1} f(t) dt $$
$$ = e^{b.D} \; \int_{x}^{x+n+1} f(t) dt =  \int_{B.(x)}^{B.(x+n+1)} f(t) dt$$
$$ = F(B.(x+n+1)) - F(B.(x)),$$
and, in particular, the string of relations
$$\sum_{k=0}^n (x+k)^s =T_x \;  \int_{x}^{x+n+1} t^{s} dt  $$
$$= e^{b.D}  \int_{x}^{x+n+1} t^{s} dt =  \int_{B.(x)}^{B.(x+n+1)} t^s dt$$
$$ =  T_x \; \frac{(x+n+1+)^{s+1} -x^{s+1}}{s+1} =  e^{b.D} \frac{(x+n+1+)^{s+1} -x^{s+1}}{s+1}$$
$$ = \frac{(B.(x+1+n))^{s+1} -(B.(x))^{s+1}}{s+1} = \frac{B_{s+1}(x+1+n) - B_{s+1}(x)}{s+1}$$
$$ = \sum_{k=0}^n \frac{B_{s+1}(x+1+k) - B_{s+1}(x+k)}{s+1}$$
$$ = \sum_{k=0}^n \frac{(B.(x+1+k))^{s+1} - (B.(x+k))^{s+1}}{s+1}$$
$$ =  \sum_{k=0}^n D_x \; \frac{(x+k)^{s+1}}{s+1}.$$
If you appropriately take the limit $s \to -1$, you arrive at a relation to the natural logarithm from whence, along with the series expansions of the trig functions in Terry Tao's answer, you can tease out your particular formulas.
For a more sophisticated illustrative application of the discretizing formula, see Eqn. 1, "the Khovanskii-Pukhlikov formula, the combinatorial
counterpart to the Hirzebruch-Riemann-Roch formula (HRR) for a smooth
toric variety X with a very ample divisor D ... " on page 2 of the "$T_y$-operator on integrals over lattice polytopes" by Goda, Kamimura, and Ohmoto.
Note also the umbral inverse sequence to the Bernoulli polynomials, the Appell power polynomials
$$\hat{B}_n(x) = \frac{(x+1)^{n+1}-x^{n+1}}{n+1},$$
with the .e.g.f. $\frac{e^t-1}{t}\; e^{xt}$, is defined also by the umbral compositional inversion
$$B_n(\hat{B}.(x)) = x^n = \hat{B}_n(B.(x)),$$
so the

*

*derivational property of the Appell Bernoulli polynomials

$$ \frac{(B_.(x)+1)^{n+1}}{n+1} - \frac{(B.(x))^{n+1}}{n+1} = \frac{(b.+x+1)^{n+1} - (b.+x)^{n+1}}{n+1}$$
$$ = \frac{B_{n+1}(x+1) - B_{n+1}(x)}{n+1}  = \hat{B}_n(B.(x)) = x^n = D \; \frac{x^{n+1}}{n+1},$$


*reciprocal relationship of the defining e.g.f.s of the moments of the inverse pair of Appell polynomial sequences

$$B(t) =e^{b.t}= \frac{t}{e^t-1},$$
$$\hat{B}(t) = e^{\hat{b}.t}=\frac{e^t-1}{t}, $$


*reciprocity of the dual ops

$$T= B(D) = \frac{D}{e^D-1} = e^{b.D},$$
$$T^{-1}= \hat{B}(D) = \frac{e^D-1}{D} = e^{\hat{b}.D},$$


*dual polynomial generating properties of the ops

$$T \; x^n = \frac{D}{e^D-1} \; x^n = e^{b.D} \; x^n = (b. + x)^n = B_n(x), $$
$$ T^{-1} \; x^n = \frac{e^D-1}{D} \; x^n = e^{\hat{b.}D} x^n = (\hat{b.}+x)^n = \hat{B}_n(x),$$


*umbral compositional inverse relationship of the dual sets of polynomials

$$ B_n(\hat{B}.(x)) = T^{-1} \; T \; x^n = x^n = T \; T^{-1} \; x^n = \hat{B}_n(B.(x)),$$


*and the discretizing property of the Todd operator

$$ x^n = T \; T^{-1} x^n = T \; \int_{x}^{x+1} t^n \; dt$$
$$ = T \frac{(x+1)^{n+1} - x^{n+1}}{n+1}$$
$$ =\frac{(B.(x)+1)^{n+1} -(B.(x))^{n+1}}{n+1} =  \hat{B}_n(B.(x))$$
are all intimately (and productively) interlinked, different facets of an Appell duality, and can be generalized via the Mellin transform. (The inverse $T^{-1}$ to the Todd operator $T$ is called the Bernoulli operator in "Recent Contributions to the Calculus of Finite Differences: A Survey" by Loeb and Rota.)
This isn't the whole story--the relationships run even deeper through a Weyl algebra, Graves/Lie/Pincherle commutator, and ladder ops--but this perspective already leads to fruitful further exploration. For example, we obtain to boot in the limit as $n \to +\infty$ for the discretizing sum a modified Hurwitz zeta function as the generalization (interpolation) of the Bernoulli polynomials,
$$ B_{-s}(x) = s \; \zeta(s+1,x),$$
which inherits the properties of an Appell sequence of polynomials.

The 'shadow' equation is somewhat restrictive since it assumes the FT of $f(x)$ exists, which is not a necessary condition for the discretizing property to apply; e.g., note the similar Laplace transform Abel-Plana formula.
With a different normalization for the FT,
$$FT(f(x)) =  \tilde{f}(\omega) = \int_{-\infty}^{\infty}  e^{-i 2\pi \omega x} f(x) \; dx,$$
and
$$f(b.+x) = e^{b.D_x} f(x) = \frac{D_x}{e^{D_x}-1} \; f(x) = \frac{D_x}{e^{D_x}-1} FT^{-1}[\tilde{f}(\omega)]$$
$$ = \frac{D_x}{e^{D_x}-1} \; \int_{-\infty}^{\infty}  e^{i 2\pi \omega x} FT[f(x)] \; d\omega =  \int_{-\infty}^{\infty}  e^{i 2\pi \omega x} \frac{i 2\pi \omega}{e^{i 2\pi \omega}-1} FT[f(x)] \; d\omega. $$
Characterizing the action of the Todd operator using rather the Mellin transform interpolation a la Ramanujan/Hardy, gives an alternate, constructive route to the Hurwitz zeta function:
$$ B_{-s}(z) = (B.(z))^{-s} = (b.+z)^{-s} = e^{b.D_z} \; z^{-s}$$
$$ = e^{b.D_z} \int_{0}^{\infty} e^{-zt} \; \frac{t^{s-1}}{(s-1)!} \; dt$$
$$ =  \int_{0}^{\infty} e^{-(b.+z)t} \; \frac{t^{s-1}}{(s-1)!} \; dt$$
$$ =\int_{0}^{\infty} e^{-B.(z)t} \; \frac{t^{s-1}}{(s-1)!} \; dt $$
$$ = \int_{0}^{\infty} \frac{-t}{e^{-t}-1} \; e^{-zt} \frac{t^{s-1}}{(s-1)!} \; dt = s \; \zeta(s+1,z).$$
A series expansion for the Appell Bernoulli function for all real or complex $s$ and real or complex $z$ with $|z-1| <  1$ is given by the umbral binomial expansion
$$s \; \zeta(s+1,z) = B_{-s}(z)$$
$$ = (b.+z)^{-s} = (b. + 1 - 1 + z)^{-s} = (B.(1)+z-1)^{-s}$$
$$ =  \sum_{n \geq 0} \binom{-s}{n} B_{-s-n}(1) \; (z-1)^n =  \sum_{n \geq 0} \binom{-s}{n} (s+n) \; \zeta(s+n+1) \; (z-1)^n$$
where
$$(b.+1)^{-s} = (B.(1))^{-s} = B_{-s}(1) = s \; \zeta(s+1,1) = s \; \zeta(s+1)$$
with $\zeta(s)$, the Riemann zeta function.
