Does $\int_0^x \tan\left(\frac\pi4e^{-t}\right) dt $ have a horizontal asymptote? Let $$f(x) = \int_0^x  \tan\left(\frac\pi4e^{-t}\right) dt.$$
Does $f(x)$ have a horizontal asymptote? If so, what value does it tend to?
Also, what are the necessary and sufficient conditions on which a function has horizontal asymptotes for a function that cannot be defined by elementary function, i.e., like above?
 A: The function $f(x) = \int_0^x \tan\left(\frac{\pi}{4} e^{-t}\right)\; dt$ does have a horizontal asymptote.  I don't know the exact value, but it is somewhere between $0$ and $\frac{\sqrt{2} \pi}{4}$.
To see this, first note that on $(0,\infty)$, $\frac{\pi}{4} e^{-t}$ takes values in $(0,\pi/4)$, and that on $(0,\pi/4)$, $\tan$ is strictly positive.  This implies that $f$ is strictly increasing on $(0,\infty)$.
Second, because $(\tan x)' = \sec^2 x$ is bounded above by $\sqrt{2}$ on $(0,\pi/4)$, it follows that $\tan(x) \leq \tan(0) + \sqrt{2}x = \sqrt{2}x$ on $(0,\pi/4)$.  Substituting $x = \frac{\pi}{4} e^{-t}$ gives $\tan \left( \frac{\pi}{4} e^{-t}\right) \leq \frac{\sqrt{2}\pi}{4}e^{-t}$ on $(0,\infty)$.  Integrating this inequality on $(0,x)$ gives $$f(x) \leq \frac{\sqrt{2}\pi}{4} \int_0^x e^{-t}\; dt \leq \frac{\sqrt{2}\pi}{4} \int_0^\infty e^{-t}\; dt = \frac{\sqrt{2}\pi}{4}.$$
So, $f$ is increasing and bounded above.  It follows that $\lim_{x\rightarrow \infty} f(x)$ exists, so $f(x)$ has a horizontal asymptote between $0$ and $\frac{\sqrt{2}\pi}{4}$.
Lastly, note that the other antiderivatives of $\tan\left(\frac{\pi}{4}e^{-t}\right)$ are vertical shifts of $f(x)$, so they also have horizontal asymptotes.
A: Horizontal asymptotes imply that the derivative of a differentiable function tends to zero at +- infinity, that is, we get a necessary condition. We can see that plus infinity is a case for the considered function.
Generally, I'd study the behavior of the Cauchy sequences for a given function. If they are dense (converge to the same limit for arbitrary intervals and sufficiently large x), asymptote detected.
As for the precise value,apart from initial conditions, I'd do a contour integration over the real line to find it. But you'll need, say, the function value at -infinity in order to know its asymptote value.
A simple estimate can be achieved via saddle point-like analysis
