How to calculate the following limits: $\lim_{x\to0}\frac{\ln\left(\cosh\left(x\right)\right)}{\ln\left(\cos\left(x\right)\right)}$ 
How to calculate the following limits:
  
  
*
  
*$\lim\limits_{x\to0}\frac{\ln\left(\cosh\left(x\right)\right)}{\ln\left(\cos\left(x\right)\right)}$
  
*$\lim\limits_{n\to\infty}\sin\left(\pi\sqrt{n^{2}+1}\right)$

$1.$
$$\frac{\ln\left(\cosh\left(x\right)\right)}
{\ln\left(\cos\left(x\right)\right)}=\log\thinspace_{\cos\left(x\right)}\left(\cosh\left(x\right)\right)=\frac{
\log\thinspace_{\cos\left(x\right)}\left(\cosh\left(x\right)\right)}{\cosh\left(x\right)-
1}\cdot\left(\cosh\left(x\right)-1\right)$$
Also setting: $\cosh\left(x\right)-1=t$
 we have:
$$\lim_{t\to0}\frac{\log\thinspace_{\cos\left(x\right)}\left(t+1\right)}{t}t=\log\thinspace_{\cos\left(x\right)}\left(e\right).0=0$$
But this is not the answer, so where is my error?
$2.$
Based on my information about the properties of limits, since sine function is continuous over its 
interval hence the given limit can be rewritten as:
$$\sin\left(\pi\lim_{n\to\infty}\sqrt{n^{2}+1}\right)$$
which does not exist, but it's not the answer, so why I'm wrong?
Also if we consider the given function as a real valued 
function,e.g.$$\lim_{x\to\infty}\sin\left(\pi\sqrt{x^{2}+1}\right)$$ does not exist, so what is the reason 
behind this fact?
Why the limit of the function as a sequence does exist but as a real valued function we do not have such 
condition? 
any elementary hint for determining the first limit is appreciated.
 A: We have that
$$\lim_{x \to 0} \frac{\log(1+x)}{x}=1$$
$$\lim_{x \to 0} \frac{1-\cos(x)}{x^2}=\frac{1}{2}$$
$$\lim_{x \to 0} \frac{1-\cosh(x)}{x^2}=-\frac{1}{2}$$
And finally
$$\frac{\log(\cosh(x))}{\log(\cos(x))}=\frac{\log(1+(\cosh(x)-1))}{\log(1+(\cos(x)-1))}=\frac{\log(1+(\cosh(x)-1))}{\cosh(x)-1}\frac{\cosh(x)-1}{x^2} \frac{x^2}{\cos(x)-1}\frac{\cos(x)-1}{\log(1+(\cos(x)-1))}$$
A: As $x\to0$, $\cos x-1\to0$ and $\cosh x-1\to0$, so $\frac{\ln\cosh x}{\cosh x-1}\to1$ and $\frac{\ln\cos x}{\cos x-1}\to1$. So your limit is$$\lim_{x\to0}\frac{\cosh x-1}{\cos x-1}=-\lim_{x\to0}\left(\frac{\sinh\frac{x}{2}}{\sin\frac{x}{2}}\right)^2=-1,$$since$$\lim_{y\to0}\frac{\sinh y}{\sin y}=\frac{\lim_{y\to0}\frac{\sinh y}{y}}{\lim_{y\to0}\frac{\sin y}{y}}=\frac11=1.$$(Your approach's mistake is that, while $\frac{\ln(t+1)}{t}\to1$, $\frac{\log_{\cos x}(t+1)}{t}$ divides this by $\ln\cos x$, which $\to0$.) For your second limit, rewrite the sine as$$(-1)^n\sin\pi(\sqrt{n^2+1}-n)=(-1)^n\sin\frac{\pi}{\sqrt{n^2+1}+n}.$$As $n\to\infty$, the argument $\to0$, so the limit is $0$. It's different with real $x$, because then $\pi x$ isn't a half-period.
A: For the limit of the sequence to be equal to the limit of the function continuity of the sine is necessary but not sufficient. The limit $$\lim_{x\to\infty}\sin\left(\pi\sqrt{x^{2}+1}\right)
$$also needs to exist for both limits to be equal (which in this case does not exist
)
The limit of the sequence is zero:
$$\lim\limits_{n\to\infty}\sin\left(\pi\sqrt{n^{2}+1}\right)=\\
=\lim\limits_{n\to\infty}(-1)^n\sin\left(\pi\sqrt{n^{2}+1}-n\pi\right)\\
=\lim\limits_{n\to\infty}(-1)^n\sin\left(\pi\left(\sqrt{n^{2}+1}-n\right)\right)\\
=\lim\limits_{n\to\infty}\sin(-1)^n\left(\pi\left(\sqrt{n^{2}+1}-n\right)\frac{\sqrt{n^{2}+1}+n}{\sqrt{n^{2}+1}+n}\right)\\
=\lim\limits_{n\to\infty}\sin\left(\frac{(-1)^n\pi}{\sqrt{n^{2}+1}+n}\right)=
\sin(0)=0$$
A: Hint: Use L'Hospital's Rule twice to find $\lim_{x\to0}\frac{\ln\left(\cosh\left(x\right)\right)}{\ln\left(\cos\left(x\right)\right)}$.
A: Do you like an insane overkill? By the Weierstrass product for the cosine function
$$ \cos(x)=\prod_{n\geq 0}\left(1-\frac{4x^2}{\pi^2(2n+1)^2}\right) $$
we have
$$ \cosh(x)=\prod_{n\geq 0}\left(1+\frac{4x^2}{\pi^2(2n+1)^2}\right) $$
hence
$$ \frac{\log\cosh(x)}{\log\cos(x)}=\frac{\sum_{n\geq 0}\log\left(1-\frac{4x^2}{\pi^2(2n+1)^2}\right)}{\sum_{n\geq 0}\log\left(1+\frac{4x^2}{\pi^2(2n+1)^2}\right)}=\frac{-\sum_{n\geq 0}\sum_{m\geq 1}\frac{4^m x^{2m}}{m\pi^{2m}(2n+1)^{2m}}}{-\sum_{n\geq 0}\sum_{m\geq 1}\frac{(-1)^m 4^m x^{2m}}{m\pi^{2m}(2n+1)^{2m}}}$$
and by switching the series on $n$ and $m$
$$ \lim_{x\to 0}\frac{\log\cosh(x)}{\log\cos(x)}=\frac{\sum_{n\geq 0}\frac{1}{(2n+1)^2}}{\sum_{n\geq 0}\frac{(-1)}{(2n+1)^2}}=\color{red}{-1}.$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
{\ln\pars{\cosh\pars{x}} \over \ln\pars{\cos\pars{x}}} &
\,\,\,\stackrel{\mrm{as}\ x\ \to\ 0}{\sim}\,\,\,
{\ln\pars{1 + x^{2}/2} \over \ln\pars{1 - x^{2}/2}}
\,\,\,\stackrel{\mrm{as}\ x\ \to\ 0}{\sim}\,\,\,
{x^{2}/2 \over -x^{2}/2} = \bbox[15px,#ffc,border:1px groove navy]{1}
\end{align}
