Evaluating $\lim_\limits{x\to 1 }\bigl( (2^x x + 1)/(3^x x)\bigr)^{\tan(\pi x/2)}$ I have to calculate limit 
$$\lim_{x\to 1 } \left(\frac{2^x x + 1}{3^x x}\right)^{\tan(\frac{\pi x}{2})}.$$
I know $\tan(\frac{\pi x}{2})$ is undefined in $x = 1$, but can I just put $x = 1$ into $\frac{x\cdot 2^x + 1}{x\cdot3^x}$ and get 
$$\lim_{x\to 1 } (1)^{\tan(\frac{\pi x}{2})} = 1.$$ 
Is the answer $1$ correct?
It's forbidden to use L'Hôpital's rule.
 A: For $x$ near $0$, $a^x=1+x\log(a)+O\left(x^2\right)$.
Furthermore, if $\lim\limits_{n\to\infty}\left|b_n\right|=\infty$ and $c=\lim\limits_{n\to\infty}a_nb_n$, then $\lim\limits_{n\to\infty}\left(1+a_n\right)^{b_n}=e^c$.
Therefore,
$$
\begin{align}
\lim_{x\to1}\left(\frac{2^xx+1}{3^xx}\right)^{\tan\left(\frac{\pi x}2\right)}
&=\lim_{x\to0}\left(\frac{2^{x+1}(x+1)+1}{3^{x+1}(x+1)}\right)^{\tan\left(\frac\pi2(x+1)\right)}\\
&=\lim_{x\to0}\left(\frac{2(1+x)\left(1+x\log(2)+O\left(x^2\right)\right)+1}{3(1+x)\left(1+x\log(3)+O\left(x^2\right)\right)}\right)^{-1/\tan\left(\frac\pi2x\right)}\\
&=\lim_{x\to0}\left(\frac{3+x(2+2\log(2))+O\left(x^2\right)}{3+x(3+3\log(3))+O\left(x^2\right)}\right)^{-1/\tan\left(\frac\pi2x\right)}\\
&=\lim_{x\to0}\left(1-\frac x3\left(1+\log\left(\frac{27}4\right)\right)+O\left(x^2\right)\right)^{-1/\tan\left(\frac\pi2x\right)}\\[9pt]
&=e^{\frac2{3\pi}\left(1+\log\left(\frac{27}4\right)\right)}
\end{align}
$$
A: Two hints: first take $\ln$, second, do a change of variable $h=x-1$.
$$
\ln L = \lim_{x\to 1}\tan\left(\frac{\pi x}2\right)\ln\left( \frac{x 2^x + 1}{x 3^x}\right) = \lim_{h\to 0}\tan\left(\frac{\pi(h+1)}2\right)\ln\left( \frac{(h+1)2^{h+1} + 1}{(h+1)3^{h+1}}\right)=\cdots
$$
Apply the trigonometric formula for the tangent of a sum...
A: Firstly, your reasoning leads to $\lim_{x\to 0} \frac{x}{x} = \lim_{x\to 0} \frac{0}{x} = 0$ 'because you can just put $x=0$ into $x$'. But of course it's wrong; you cannot replace part of an expression with something else that isn't equal. Indeed the limit is more-or-less defined as the value (if it exists) that you would eventually approach as $x$ gets closer but never reaches $0$.
With that understood, you always want to express $a^b = \exp(b \cdot \ln(a))$ so that you can use Taylor expansion. And usually it's easier to understand the behaviour and expand around $0$, so we should compute $\lim_{d\to 0} \left(\dfrac{2^{1+d} (1+d) + 1}{3^{1+d} (1+d)}\right)^{\tan(\frac{\pi (1+d)}{2})}$ instead. The method I will use is asymptotic expansion using Landau's Little-O-notation, which I would encourage you to learn, as it applies to any limit problem in general.
$\def\wi{\subseteq}$
Basic asymptotic expansions
$\exp(x) \in 1+x+o(x)$ as $x \to 0$.
$\ln(1+x) \in x+o(x)$ as $x \to 0$.
$a^x = \exp(x\ln(a)) \in 1+x\ln(a)+o(x)$ as $x \to 0$, for any $a > 0$.
You can of course use more terms from the respective Taylor expansions if the first-order terms cancel and are not enough.
Solution
As $d \to 0$:
  $\left(\dfrac{2^{1+d} (1+d) + 1}{3^{1+d} (1+d)}\right)^{\tan(\frac{\pi (1+d)}{2})}$
  $= \exp\left( \tan(\frac{\pi (1+d)}{2}) \ln\!\left(\dfrac{2^d 2(1+d) + 1}{3^d 3(1+d)}\right) \right)$
  $\in \exp\left( \dfrac{1}{\tan(-\frac{\pi}{2}d)} \ln\!\left(\dfrac{(1+d\ln(2)+o(d)) 2(1+d) + 1}{(1+d\ln(3)+o(d)) 3(1+d)}\right) \right)$
  $\wi \exp\left( \dfrac{1}{-\frac{\pi}{2}d+o(d)} \ln\!\left(\dfrac{3+(2\ln(2)+2)d+o(d)}{3+(3\ln(3)+3)d+o(d)}\right) \right)$
  $\wi \exp\left( \dfrac{1}{-\frac{\pi}{2}d} (1+o(1)) \ln\!\Big(1-\frac{3\ln(3)-2\ln(2)+1}{3}d+o(d)\Big) \right)$
  $\wi \exp\left( \dfrac{1}{-\frac{\pi}{2}d} (1+o(1)) \Big(-\frac{3\ln(3)-2\ln(2)+1}{3}d+o(d)\Big) \right)$
  $\wi \exp\left( \dfrac{2}{\pi} (1+o(1)) \Big(\frac{3\ln(3)-2\ln(2)+1}{3}+o(1)\Big) \right)$
  $\wi \exp\left( \dfrac{2(3\ln(3)-2\ln(2)+1)}{3\pi} + o(1) \right)$
  $\wi \exp\left( \dfrac{2(3\ln(3)-2\ln(2)+1)}{3\pi} \right) \exp(o(1))$
  $\to \exp\left( \dfrac{2(3\ln(3)-2\ln(2)+1)}{3\pi} \right)$.
Comments
This kind of technique is what computer algebra systems do as well, such as Wolfram Alpha.
A: Let $$y = \left( \frac{x 2^x + 1}{x 3^x}\right)^{\tan\left(\frac{\pi x}{2}\right)}$$
Then $$\ln(y) = \tan\left(\frac{\pi x}{2}\right)\ln\left( \frac{x 2^x + 1}{x 3^x}\right) = \frac{\ln\left( \frac{x 2^x + 1}{x 3^x}\right)}{\frac{1}{\tan\left(\frac{\pi x}{2}\right)}}$$
Apply L'Hôpital's rule to obtain your answer, it is still a lot of work. Maybe there is a faster way to go about this problem.
