Showing $\lim_{x\to 1^+}\left(\frac{\tan(\ln x)}{(x-1)^2}-\frac{\sec^2(\ln x)}{x(x-1)}\right) = \frac{1}{2}$ I want to prove that $$\lim_{x\to 1^+}\left(\frac{\tan(\ln x)}{(x-1)^2}-\frac{\sec^2(\ln x)}{x(x-1)}\right) = \frac{1}{2}$$
I tried to use L'hospital, but the expression gets out of hand very quickly.
I am thinking about Taylor expansion at $x=1$, and take the difference of the series. Is this approach possible?
Any kind soul, please enlighten!
 A: Generally, by L'Hospital's Rule,
$$
\lim_{x\to a}\frac{f(x)-f(a)-(x-a)f'(x)}{(x-a)^2} = -\frac{f''(a)}2.
$$
Now, rewrite your limit (which does not need to be a one-sided limit) as follows.
$$
\lim_{x\to 1}\frac{\tan(\ln(x))-\tan(\ln(1))-(x-1)\frac{\mathrm d}{\mathrm dx}(\tan(\ln(x)))}{(x-1)^2}
$$
Thus, the problem comes down to evaluating the second derivative of $\tan(\ln(x))$ at $x=1$.
A: Setting $\newcommand{\eps}{\varepsilon} \eps = x-1$ and using $\tan' = \sec^2$, we can rewrite the expression as
$$ \frac{(\eps + 1) \tan(\ln(1 + \eps)) - \eps \tan'(\ln(1 + \eps))}{(\eps + 1)\eps^2} $$
In order to apply L'Hospital, we calculate the first derivative of the numerator:
$$ \begin{align}\tan(\ln(1 + \eps))  +& (\eps + 1) \tan'(\ln(1 + \eps))\frac1{1 + \eps} - \tan'(\ln(1 + \eps)) - \eps \tan''(\ln(1 + \eps))\frac1{1 + \eps} \\
&= \tan(\ln(1 + \eps)) - \frac{\eps}{1 + \eps} \tan''(\ln(1 + \eps)) \\
&= \tan(\ln(1 + \eps)) \left( 1 - \frac{2 \eps}{(1 + \eps)\cos(1 + \eps)^2}\right)
\end{align}
$$
In the last step we use $\tan'' = 2 \sec^2 \tan$. The term in the brackets has limit $1$ when when $\eps \to 0$ so the limit of the original expression is
$$\frac{\tan(\ln(1 + \eps))}{3 \eps^2 + 2 \eps}$$
Applying L'Hopital again, we get that it's limit is equal to 
$$ \frac{\sec^2(\ln(1 + 0))\frac1{1 + 0}}{6\cdot 0 + 2}  = \frac12$$
(In the last step, you can also do a Taylor expansion $\ln(1 + \eps) \approx \eps$ and $\tan(\eps) \approx \eps$)
A: Your term is equal to $$\frac{x\tan(\ln(x))-(x-1)^2\sec^2(\ln(x))}{x(x-1)^2}$$ now use the rules of L'Hospital.
A: Let's put $x=1+h$ so that $h\to 0^{+}$ and then the desired limit is equal to the limit of the expression $$\frac{(1+h)\tan(\log(1+h))-h\sec^2(\log(1+h))}{h^2}$$ To simplify typing let's put $t=\log(1+h)$ so that $t\to 0^{+}$ and $t/h\to 1$. The above expression is $$\frac{h\tan t+\tan t-h-h\tan^2 t} {h^2}$$ which is same as $$\frac{\tan t} {t}\cdot\frac {t} {h} - h\cdot\frac{\tan^2 t} {t^2}\cdot\frac{t^2}{h^2}+ \frac{\tan t-h}{h^2}$$ The first term tends to $1$ and second term tends to $0$ and hence our job is done if we can show that the last term tends to $-1/2$. We can rewrite the last term as $$\frac{\tan t-t} {t^2}\cdot\frac{t^2}{h^2}+\frac{t-h}{h^2}$$ Again the first term above tends to $0$ and the remaining term can be written as $$\frac{\log(1+h)-h}{h^2}$$ which clearly tends to $-1/2$ via L'Hospital's Rule or Taylor series. Thus the proof that the original limit is $1/2$ is complete.

The problem is made visually complicated by composing logs with trig function but as can be seen the argument of each trig function involved is $\log x$ and thus replacing it with another variable $t$ makes the problem simpler (at least visually). And then one can attack the problem with more confidence. You can see that the above solution requires the use of L'Hospital's Rule or Taylor at a single place. 
