<s>[INST] Calculating the improper integral $\int _{1}^{\infty}\frac{e^{\sin x}\cos x}{x}\,dx$ I want to calculate the value of $$\int_{1}^{\infty}\frac{e^{\sin x}\cos x}{x}\,dx$$
I was able to prove using Dirichlet's test that it does converge, but how can I calculate its value?
 [/INST] We have that, integrating by parts
$$
\eqalign{
  & I = \int_1^\infty  {e^{\,\sin x} {{\cos x} \over x}dx}
  = \int_1^\infty  {{1 \over x}d\left( {e^{\,\sin x} } \right)}  =   \cr 
  &  = \left. {{{e^{\,\sin x} } \over x}} \right|_1^\infty
   - \int_1^\infty  {e^{\,\sin x} d\left( {{1 \over x}} \right)}
  =  - e^{\,\sin 1}  + \int_1^\infty  {{{e^{\,\sin x} } \over {x^{\,2} }}dx}  =   \cr 
  &  =  - e^{\,\sin 1}  + J \cr} 
$$
with the advantage of having replaced $1/x$ with $1/x^2$.
Then being $\exp(\sin x)$ periodic
$$
\eqalign{
  & J = \int_1^\infty  {{{e^{\,\sin x} } \over {x^{\,2} }}dx}
  = \int_1^{1 + 2\pi } {{{e^{\,\sin x} } \over {x^{\,2} }}dx}
  + \int_{1 + 2\pi }^{1 + 4\pi } {{{e^{\,\sin x} } \over {x^{\,2} }}dx}  +  \cdots  =   \cr 
  &  = \sum\limits_{0\, \le \,k} {\int_{1 + k2\pi }^{1 + \left( {k + 1} \right)2\pi } {{{e^{\,\sin x} } \over {x^{\,2} }}dx} }
  = \sum\limits_{0\, \le \,k} {\int_0^{2\pi }
 {{{e^{\,\sin \left( {x + 1} \right)} } \over {\left( {x + 1 + k2\pi } \right)^{\,2} }}dx} }  =   \cr 
  &  = {1 \over {4\pi ^{\,2} }}\int_0^{2\pi } {e^{\,\sin \left( {x + 1} \right)}
 \left( {\sum\limits_{0\, \le \,k}
 {{1 \over {\left( {{{\left( {x + 1} \right)} \over {2\pi }} + k} \right)^{\,2} }}} } \right)dx}  =   \cr 
  &  = {1 \over {4\pi ^{\,2} }}\int_0^{2\pi }
 {e^{\,\sin \left( {x + 1} \right)} \zeta \left( {2,{{x + 1} \over {2\pi }}} \right)dx}  =   \cr 
  &  = {1 \over {4\pi ^{\,2} }}\int_0^{2\pi }
 {e^{\,\sin \left( {x + 1} \right)} \psi ^{\left( 1 \right)} \left( {{{x + 1} \over {2\pi }}} \right)dx}  =   \cr 
  &  = {1 \over {2\pi }}\int_0^{2\pi }
 {e^{\,\sin \left( {x + 1} \right)} \psi ^{\left( 1 \right)} \left( {{{x + 1} \over {2\pi }}} \right)
d\left( {{{x + 1} \over {2\pi }}} \right)}  =   \cr 
  &  = {1 \over {2\pi }}\int_{{1 \over {2\pi }}}^{{1 \over {2\pi }} + 1}
 {e^{\,\sin \left( {2\pi t} \right)} \psi ^{\left( 1 \right)} \left( t \right)d\left( t \right)}   \cr 
  } 
$$
where $\psi ^{\left( 1 \right)} \left( t \right)$ denotes the
Trigamma Function.
So we have reduced the improper integral to a proper integral,
much more manageable by numeric integration.
My CAS gives:
$$
\eqalign{
  & J \approx 1 .94017  \cr 
  & {\rm I} \approx  - \,0.3796 \cr} 
$$
</s>