For the trick to work, we need to make sure beforehand that Leibniz's integral rule is satisfied, that is, given \begin{equation} \int_{a(x)}^{b(x)}f(x,t)dt \end{equation} we need that both $f(x,t)$ and it's partial in $x$ are continuous in $x$ and $t$ for all $a(x) \leq t \leq b(x)$ and $x_0 \leq x \leq x_1$, for some $x_0, x_1$ (pulled from the wiki on Leibniz integral rule).
What confuses me is, when looking at the classic example for using Feynman's trick to solve a tricky integral, namely \begin{equation} \int_{0}^{1}\frac{x^{2}-1}{\ln{x}}dx \end{equation} we find that before substituting in another variable in the integrand for the trick, although $\frac{x^{2}-1}{\ln{x}}$ is continuous on $[0,1]$, its derivative diverges at $x=0$. Why are we allowed to use this technique on this integral?