$\lim_{x \to + \frac{1}{2}} [ \tan(\pi x^2)+(2x-1)4^x+6x-4 ] \cot(x-\frac{1}{2})$ I've tried to solve this limit:
$\lim_{x \to + \frac{1}{2}}  \left [ \tan(\pi x^2)+(2x-1)4^x+6x-4 \right ] \cot(x-\frac{1}{2})$
the first parentesis should tend to $\frac{\sqrt{2}}{2}-1$ but I don't know how to procede.
The final result should be $2 \pi + 10$
 A: To make life easier, let $x=y+\frac 12$ to make the expression
$$\left(\left(4^{y+1}+6\right) y+\tan \left(\frac{1}{4} \pi  (2
   y+1)^2\right)-1\right) \cot (y)$$ and now, compose series one piece at the time
$$4^{y+1}=4 e^{y \log(4)}=4+4 y \log (4)+2 y^2 \log ^2(4)++O\left(y^3\right)$$
Now,   after expansion of the argument, and using $\tan(a+b)=\cdots$
$$\tan \left(\frac{1}{4} \pi  (2y+1)^2\right)=1+2 \pi  y+2 \left(\pi +\pi ^2\right) y^2+O\left(y^3\right)$$
$$\left(4^{y+1}+6\right) y+\tan \left(\frac{1}{4} \pi  (2
   y+1)^2\right)-1=(10+2 \pi ) y+y^2 \left(2 \left(\pi +\pi ^2\right)+4 \log(4)\right)+O\left(y^3\right)$$
$$\cot(y)=\frac{1}{y}-\frac{y}{3}+O\left(y^3\right)$$ Make the product and the expression is
$$(10+2 \pi )+y \left(2 \pi\left(\pi +1\right)+8 \log (2)\right)+O\left(y^2\right)$$ which shows the limit and also how it is approached.
Edit for clarification about $\tan \left(\frac{1}{4} \pi  (2y+1)^2\right)$
$$\frac{1}{4} \pi  (2y+1)^2=\frac{\pi }{4}+\pi  y(y+1)=\frac{\pi }{4}+a$$
$$\tan \left(\frac{\pi }{4}+a\right)=\frac{1+\tan(a)}{1-\tan(a)}=\frac {1+a+\frac{a^3}{3}+\frac{2 a^5}{15}+O\left(a^7\right) } {1-a-\frac{a^3}{3}-\frac{2 a^5}{15}+O\left(a^7\right) }$$
Long division
$$\tan \left(\frac{\pi }{4}+a\right)=1+2 a+2 a^2+\frac{8 a^3}{3}+\frac{10 a^4}{3}+\frac{64 a^5}{15}+\frac{244
   a^6}{45}+O\left(a^7\right)$$ Now, replace $a=\pi  y(y+1)$
$$\tan \left(\frac{1}{4} \pi  (2y+1)^2\right)=1+2 \pi  y+2 \left(\pi +\pi ^2\right) y^2+O\left(y^3\right)$$
A: Let $~f(x) = \left[\tan(\pi x^2)+(2x-1)4^x+6x-4 \right]~$ and 
let $~g(x) = \tan[x - (1/2)].$
Note that $g(x)$ and each term of $f(x)$ are continuous functions.
You want $\lim_{x\to (1/2)} \frac{f(x)}{g(x)}.$
Before applying L'Hopital's rule, first check $f(1/2)$ and $g(1/2)$.
$$f(1/2) = \tan(\pi/4) + (0)4^{(1/2)} + 3 - 4 = 1 + 3 - 4 = 0.$$
$$g(1/2) = \tan(0) = 0.$$
Applying L'Hopital's rule:
$$f'(x)|_{x=(1/2)}
~=~\frac{(2\pi)x}{\cos^2(\pi x^2)} + (2)(4^x) + (2x - 1)\log(4)[4^x] + 6 ~|_{x = (1/2)}
$$
$$= \frac{\pi}{(1/\sqrt{2})^2} + (2)(2) + (0)\log(4)(2) + 6 
~=~ 2\pi + 4 + 0 + 6 ~=~ 2\pi + 10.$$
and
$$g'(x) ~|_{x = (1/2)}
~=~ \frac{1}{\cos^2(x - 1/2)} ~|_{x = (1/2)} = 1.$$
Thus, $$\frac{f'(1/2)}{g'(1/2)} = \frac{2\pi + 10}{1}.$$
