solving a singular integral equation using Mellin transform 
Solve the following singular integral equation using suitable integral
  transform : $$\int_0^\infty u(t)\cos(xt)dt=e^{-x}$$

One easy method is if I use fourier cosine transform. But instead I chose to apply Mellin transform, to see what happens next. We know that $$\mathcal{M}\bigg(\int_0^\infty u(t)\cos(xt)dt;s\bigg)=U(1-s)\Gamma(s)\cos\bigg(\frac{s\pi}{2}\bigg)$$ where $U(s)=\mathcal{M}(u(x);s)$ and $$\mathcal{M}(e^{-x};s)=\Gamma(s)$$ Now, we have fom the given equation $$U(1-s)\Gamma(s)\cos\bigg(\frac{s\pi}{2}\bigg)=\Gamma(s)$$ $$\implies U(s)=\text{cosec}\bigg(\frac{s\pi}{2}\bigg)$$ Taking Mellin inverse $$u(x)=\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty} x^{-s}\text{cosec}\bigg(\frac{s\pi}{2}\bigg)ds$$
Now I can't apply the method of residues as the cosecant term being present in the integrand. How to evaluate the above complex integral? Any help is appreciated.
 A: Clearly, the Mellin transform identity for $\cos$ is valid only when $0<\Re s<1$. Hence, we are forced to choose $c\in (0,1)$ for Mellin inverse.
Let’s first solve for $u(x)$ when $0<x<1$.
In this case, the integrand decays exponentially on the left half plane due to $x^s=e^{(\ln x)s}$. Hence, we choose a contour from $c-i\infty$ to $c+i\infty$, and close the contour by attaching a infinitely big semicircle on its left.
Obviously, the integral over the arc vanishes. Therefore, by residue theorem, the Mellin inverse equals
$$\sum\text{residues of $x^{-s}\csc\frac{\pi s}2$ on the left half plane}$$
Note that singularities enclosed are simple poles and are at $s=-2n$, $n=0,1,2,\cdots$. The residue is
$$x^{2n}\lim_{s\to -2n}(s+2n)\csc\frac{\pi s}2=\frac{2}{\pi}(-1)^n x^{2n}$$
Summing the residue from $n=0$ to $\infty$, we found that the Mellin inverse is
$$u(x)=\frac{2}{\pi}\frac{1}{x^2+1}$$
It is (un)surprising that we get the same result for $x>1$ (semicircle on the right half plane) - this is an instance of analytic continuation. Hence, we conclude that $\frac{2}{\pi}\frac{1}{x^2+1} $ is the solution of $u(x)$ for all $x>0$.
Note that this question is highly similar to another one I recently answered. The two different solutions are respectively the real and imaginary parts of $\frac 2\pi \frac1{1-ix}$, depending on whether it is a $\cos$ or a $\sin$.
A: $u(t)$ is defined for $t>0$ but $$\int_0^\infty u(t)\cos(xt)dt=e^{-|x|}$$
is defined for all $x\in \Bbb{R}$.
The inverse Fourier transform gives the unique solution $$u(t)=A(\frac1{t+i}+\frac1{-t+i}), t > 0$$
Expand in power series at $t=0$ you'll find that for $c\in (0,1)$, $t\in (0,1)$ it fits with $$\sum_{\Re(s) < 0} Res(t^{-s}\text{cosec}\bigg(\frac{s\pi}{2}\bigg),s)=\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty} t^{-s}\text{cosec}\bigg(\frac{s\pi}{2}\bigg)ds$$
Then you need the analytic continuation theorem :

$\text{cosec}(\frac{s\pi}{2})$ has exponential decay on  the vertical line $\Re(s)=c$ thus its inverse Fourier/Laplace/Mellin transform is analytic.
Whence its inverse Mellin transform is the analytic continuation of $\sum_{\Re(s) < 0} Res(t^{-s}\text{cosec}\bigg(\frac{s\pi}{2}\bigg),s)$ ie. it is $A(\frac1{t+i}+\frac1{-t+i})$

The whole thing is called Ramanujan master theorem.
