Using differentiation under the integral sign to evaluate $\int\ln(x^n+1) \,\mathrm dx$ This is my first stack exchange question, so sorry if it is not neat. So for
$$\int\ln(x^n+1)\,\mathrm dx,
$$
I tried doing $\ln(a(x^n + 1))$ where $a = 1$ and differentiating under the integral. So I set the integral is $Q(a)$ and get
$$
Q^\prime(a)=\int 1/a\,\mathrm dx
$$
because we treat $(x^n + 1)$ like a coefficient. And then $Q^\prime(a) = dQ/da=x/a$, so $Q = x\ln(a) + C$ but setting $a = 1$ you get $Q(1) = C$ and the derivative of $C$ is $0$, which isn't $\ln(x^n + 1)$. So what did I do wrong?
 A: Your mistake was in failing to recognize that $$Q(x,a)=x\ln(a)+xC(a)+k(x).$$ You assumed $C$ is a constant function, but it is not. The way this works is that $$Q(x,a)=\int\ln[a(x^n+1)]\,\mathrm{d}x,$$ so $$\frac{\partial{Q}}{\partial{a}}(x,a)=\int\frac1{a}\,\mathrm{d}x=\int{f(x,a)}\,\mathrm{d}x=\int\frac{\partial{g}}{\partial{x}}(x,a)\,\mathrm{d}x,$$ and since $$f(x,a)=\frac1{a}$$ implies $$g(x,a)=\frac{x}{a}+c(a),$$ you have that $$\frac{\partial{Q}}{\partial{a}}(x,a)=\frac{x}{a}+c(a),$$ hence $$Q(x,a)=x\ln(a)+x\int{c(a)}\,\mathrm{d}a+k(x)=x\ln(a)+xC(a)+k(x).$$ We know that $$\frac{\partial{Q}}{\partial{x}}(x,a)=\ln[a(x^n+1)],$$ and from the answer above, one can conclude that $$\frac{\partial{Q}}{\partial{x}}(x,a)=\ln(a)+C(a)+k'(x),$$ we can thus conclude $$\ln(a)+\ln(x^n+1)=\ln(a)+C(a)+k'(x),$$ which leaves you with $C(a)=0,$ and $$k'(x)=\ln(x^n+1)=Q(x,1),$$ which is the very thing you were trying to find in the beginning.
The method is fundamentally flawed, because to begin with, $$\ln[a(x^n+1)]=\ln(a)+\ln(x^n+1),$$ so necessarily, $$Q(x,a)=x\ln(a)+Q(x,1),$$ so this variant of Feynman's technique useless in this instance.
