<s>[INST] Need help with taylor series. 
Evaluate the limit
  $$\lim\limits_{x \to 1} \frac{1-x + \ln x}{1+ \cos πx}$$

The limit im trying to get is $-\frac{1}{π^2}$ as I've solved from l'Hopitals rule.
Now I need to solve the limit by using Taylor Series and this is what i did so far
$$\begin{align*}
f(x) &= 1-x + \ln x = 1 -x + (x-1) + \frac{1}{2} (x-1)^2 + \frac{1}{3} (x-1)^3 - \frac{1}{4} (x-1)^4 + \ldots \\
g(x) &= 1+\cos πx = 1+\left[ 1+\frac{1}{2!} (πx)^2 + \frac{1}{4!} (πx)^4 - \frac{1}{6!} (πx)^6  +\ldots \right] \\
\frac {f(x)}{g(x)} & = \frac{\frac{1}{2} (x-1)^2 + \frac{1}{3} (x-1)^3 - \frac{1}{4}(x-1)^4 + \ldots} {2-\frac{1}{2!} (πx)^2 + \frac{1}{4!} (πx)^4 - \frac{1}{6!} (πx)^6+\ldots}
\end{align*}$$
I have no idea where to go to solve for $-\frac{1}{π^2}$ now. Please help 
 [/INST] First, let $h=x-1$ then $\cos \pi x=\cos (\pi +\pi h)=-\cos (\pi h).$ 
Next re-write the original fraction as the following product
\begin{equation*}
\frac{1-x+\ln x}{1+\cos \pi x}=\frac{-h+\ln (1+h)}{1-\cos (\pi h)}=\frac{%
-h+\ln (1+h)}{h^{2}}\times \frac{(\pi h)^{2}}{(1-\cos (\pi h))}\times \frac{1%
}{\pi ^{2}}.
\end{equation*}
By Taylor expansion we can note that 
\begin{align}
\cos \pi h& =1-\frac{(\pi h)^{2}}{2}+o(h^{3})  \notag \\
\log (1+h)& =h-\frac{h^{2}}{2}+o(h^{3}).  \notag
\end{align}
then
\begin{equation*}
\lim_{h\rightarrow 0}\frac{-h+\log (1+h)}{h^{2}}=\lim_{h\rightarrow 0}(-%
\frac{1}{2}+o(h))=-\frac{1}{2}.
\end{equation*}
\begin{equation}
\lim_{h\rightarrow 0}\frac{1-\cos (\pi h)}{(\pi h)^{2}}=\lim_{h\rightarrow 0}%
\frac{\frac{(\pi h)^{2}}{2}+o(h^{3})}{(\pi h)^{2}}=\lim_{h\rightarrow 0}%
\frac{1}{2}+\frac{1}{\pi ^{2}}o(h)=\frac{1}{2}.  
\end{equation}
Therefore
\begin{eqnarray*}
\lim_{x\rightarrow 1}\frac{1-x+\ln x}{1+\cos \pi x} &=&\lim_{h\rightarrow 0}%
\frac{-h+\ln (1+h)}{h^{2}}\cdot \frac{(\pi h)^{2}}{(1-\cos (\pi h))}\cdot 
\frac{1}{\pi ^{2}}. \\
&=&\lim_{h\rightarrow 0}\frac{-h+\ln (1+h)}{h^{2}}\cdot \lim_{h\rightarrow 0}%
\frac{(\pi h)^{2}}{(1-\cos (\pi h))}\cdot \lim_{h\rightarrow 0}\frac{1}{\pi
^{2}}. \\
&=&-\frac{1}{2}\cdot \frac{2}{1}\cdot \frac{1}{\pi ^{2}} \\
&=&-\frac{1}{\pi ^{2}}.
\end{eqnarray*}
$\bf{EDIT:}$ You stack because you tried to deal with the whole expression at ONCE. My computations were done TWO times but on A SMALL piece at a time: Divide and conquer! 
</s>