For fun, I am trying to solve the false "theorem" $$\int\frac1{f(x)}dx=\frac1{\int f(x)dx}$$ for all functions $f$ that satisfy the above equation. I got a solution but it seems to be wrong, and I was wondering where it went wrong. Here's how I did it:
I first started by differentiating both sides, using Chain Rule on the RHS: $$\frac1{f(x)}=-\frac{f(x)}{(\int f(x)dx)^2}$$ Cross multiplying, I get: $$-(f(x))^2=\left(\int f(x)dx\right)^2$$ So: $$\int f(x)dx=\sqrt{-(f(x))^2}$$ Then, differentiating both sides again: $$f(x)=\frac12(-(f(x))^2)^{-1/2}\cdot(-2f(x))\cdot f'(x)$$ Which simplifies to (I switch from $f(x)$ to $y$ from here to make it easier to keep track of the variables): $$y=-(-y^2)^{-1/2}\cdot\frac{dy}{dx}$$ Separating the variables: $$dx=\frac{-(-y^2)^{-1/2}}ydy$$ At this point I'm not sure what else to do so I introduce the imaginary numbers into the equation (this is where it starts getting iffy for me, because I never mixed imaginary numbers with integration before): $$dx=\frac{-(-1)^{-1/2}\cdot(y^2)^{-1/2}}ydy$$ $$dx=\frac{-1/i}{y^2}dy$$ $$\int dx=-\frac1i\int\frac1{y^2}dy$$ $$x+C_1=-\frac1i\cdot\left(-\frac1y+C_2\right)$$ $$x+C_1=\frac1{yi}+C_2$$ $$x+C_3=\frac1{yi}$$ $$yi=\frac1{x+C_3}$$ $$\boxed{f(x)=\frac1{ix+C}}$$ where $C$ is an arbitrary complex number.
But the problem with this solution is when I try to plug this back into the original equation, it doesn't seem to make the equation true. For example, let's say I choose $C=0$, so that $f(x)=\frac1{ix}$. Then the LHS becomes: $$\int\frac1{f(x)}dx=\int ixdx=i\frac{x^2}2+C_4$$ But the RHS becomes: $$\frac1{\int f(x)dx}=\frac1{\int\frac1{ix}dx}=\frac1{\frac1i\ln|x|+C_5}$$ which obviously don't match each other at all.