Computational complexity of calculating the $n$th derivative of $f(x)=\exp\bigg(\frac{1}{\ln(x)}+\frac{1}{\ln(1-x)}\bigg)$? Computational complexity of calculating $$ f^{(n)}(x)? $$ where $f(x)=\exp\bigg(\frac{1}{\ln(x)}+\frac{1}{\ln(1-x)}\bigg)$
I don't know much about computational complexity but I do know that the derivatives just keep accumulating more and more mass.
I think the running time is exponential time. What's the fastest running time it can be calculated in?

The answer by Steven Stadnicki isn't quite right. For each term with exponents $(a,b,c,d)$, you get six terms in the next derivative:


*

*$(a-1,b,c,d)$

*$(a-1,b-1,c,d)$

*$(a,b,c-1,d)$

*$(a,b,c-1,d-1)$

*$(a-1,b-2,c,d)$

*$(a,b,c-1,d-2)$
The first four come from differentiating $x$, $\ln x$, $(1-x)$, $\ln (1-x)$ respectively. The last one comes from differentiating the exponential, which multiplies by $(-x^{-1}(\ln x)^{-2} + (1-x)^{-1}(\ln (1-x))^{-2})$. This means that $0 \ge b \ge 2a$ and $0 \ge d \ge 2c$. So there's four times as many as he thought.
But luckily, it's actually much better than he thought. Notice that the sum $a+c$ always decreases by one, so $-(a+c)=n$. That means the number of terms in the $n$-th derivative is only $O(n^3)$, and the total time is $O(n^4)$.
But we can do much better. Define $$g(x) = \exp\bigg( {1 \over {\ln x}} \bigg)$$ so $$f(x)= g(x) \cdot g(1-x)$$
By the General Leibniz rule, $$f^{(n)}(x) = \sum_{i=0}^n {n \choose i} (-1)^{n-i} g^{(i)}(x)g^{(n-i)}(1-x)$$
When you compute the derivatives of $g$, you only have the $x$ and $\ln x$ factors, so $g^{(n)}$ only has $O(n)$ terms, and the total time is $O(n^2)$.
