What is the $n^{th}$ term derivative of $f(x) = (x^2-x-1)(\ln(1-x))$? I have the first three terms but am struggling with finding the $n^{th}$ term derivative of the function. Here is my work:
$$\\$$
$$f(x) = (x^2-x-1)(\ln(1-x)) $$
$$f'(x) = (2x-1)(\ln(1-x))-\left(\dfrac{x^2-x-1}{1-x}\right)$$
$$f''(x) = \dfrac{3x^2-5x+2(x-1)^2 \ln(1-x)+3}{(1-x)^2}$$
$$f'''(x) = \dfrac{2x^2-5x+1}{(x-1)^3}$$
$$f^{(n)}(x) = \ ?$$
 A: Use the following.
$$f'''(x)=\frac{2x^2-5x+1}{(x-1)^3}=\frac{2x^2-4x+2-x+1-2}{(x-1)^3}=\frac{2}{x-1}-\frac{1}{(x-1)^2}-\frac{2}{(x-1)^3}.$$
Can you end it now?
A: As you noticed,
$$
f^{(3)}(x)=\frac{2x^{2}-5x+1}{\left(x-1\right)^{3}}.
$$
Wolfram claims that
$$
f^{(3+n)}(x)=n!\frac{n^{2}+n\left(x+2\right)-2x^{2}+5x-1}{\left(x-1\right)^{3+n}}.
$$
To convince yourself that this is indeed the case, fix $n\geq0$ and differentiate the expression for $f^{(3+n)}$ to get the expression for $f^{(3+n+1)}$.
A: It might be useful here to make a small substitution and to expand the parentheses:


*

*$y = 1-x \Rightarrow y' = -1$

*$\Rightarrow f(x) = g(y(x)) = -(1+x(1-x))\ln (1-x) = -(1+(1-y)y)\ln y$
Now differentiate $\boxed{g(y) = -\ln y - y\ln y + y^2 \ln y}$ with respect to $x$ and have in mind that $\color{blue}{y'(x) = -1}$ (which leads to the changing signs below):
\begin{eqnarray*}
f'(x) & = & \frac{1}{y} + (\ln y + 1) - (2y\ln y + y) \\
f''(x) & = & \frac{1}{y^2} - \frac{1}{y} + (2\ln y + 2) +1 \\
f^{(3)}(x) & = & \frac{2}{y^3} - \frac{1}{y^2} - \frac{2}{y}\\
 & \ldots & \\
f^{(n)} & = & \ldots \\
\end{eqnarray*}
For example replacing $y = 1-x$ gives $f^{(3)}(x) = \frac{2}{(1-x)^3} - \frac{1}{(1-x)^2} - \frac{2}{1-x}$.
