# Functional inverse of $(a + b\sin\theta)^2\tan\theta$

So, I revisited to the situation involved in my previous question, with the intent of generalizing it to any two masses and charges. When I started going through the model again, beginning with the solution for equal-masses-unequal-charges, I found out that my equation (of the form $\frac{Q}{4L^2} = \tan\theta\,\sin^2\theta$) was incorrect. It should have actually been $$Q = \tan\theta\,(x + 2L\sin\theta)^2$$ (that is to say, there was an $x$ that had to be added to the sine term before squaring and multiplying) which looks even nastier than before. $Q$ is to be the input value (encompassing both charges and most of the fixed parameters), and $L$ and $x$ are fixed. The range of values for $\theta$ is now $-\pi/2\lt0\lt\pi/2$, and $x$ can be any real number. The method of solving it from before hasn't helped much, because I have no idea what to do with the middle term of the expansion of the square (which is $4xL\,\sin\theta\,\tan\theta = 4xL\,\tan^2\theta\,\cos\theta$).

Edit: I toyed around with the equation and some trig formulas, and ulitmately I got to the following (defining $\alpha = \tan\frac\theta2$, and noting that $(1-\alpha^2)^2+4\alpha^2=(1+\alpha^2)^2$): \begin{align*}Q&=\tan\theta\,(x + 2L\sin\theta)\\ &=x^2\tan\theta+4xL\sin\theta\tan\theta+4L^2\sin^2\theta\tan\theta\\ &=x^2\frac{\tan\theta(1+\tan^2\theta)}{1+\tan^2\theta}+4L^2\frac{\tan^3\theta}{\sec\theta}+4xL\frac{\sin^2\theta}{\cos\theta}\\ &=\frac{x^2\tan\theta(1+\tan^2\theta)+4L^2\tan^3\theta}{1+\tan^2\theta}+4xL\cdot\left(\frac{2\alpha}{1+\alpha^2}\right)^2\cdot\frac{1+\alpha^2}{1-\alpha^2}\\ &=\frac{x^2\cdot\frac{2\alpha}{1-\alpha^2}\cdot\left(1+\left(\frac{2\alpha}{1-\alpha^2}\right)^2\right)+4L^2\cdot\left(\frac{2\alpha}{1-\alpha^2}\right)^3}{1+\left(\frac{2\alpha}{1-\alpha^2}\right)^2}+4xL\frac{4\alpha^2}{(1+\alpha^2)(1-\alpha^2)}\\ &=\frac{\frac{2x^2\alpha}{1-\alpha^2}\cdot\frac{(1-\alpha^2)^2+4\alpha^2}{(1-\alpha^2)^2}+\frac{32L^2\alpha^3}{(1-\alpha^2)^3}}{\frac{(1-\alpha^2)^2+4\alpha^2}{(1-\alpha^2)^2}}+\frac{16xL\alpha^2}{1-\alpha^4}\\ &=\frac{2x^2\alpha((1-\alpha^2)^2+4\alpha^2)+32L^2\alpha^3}{(1-\alpha^2)^3}\cdot\frac{(1-\alpha^2)^2}{(1-\alpha^2)^2+4\alpha^2}+\frac{16xL\alpha^2}{(1+\alpha^2)(1-\alpha^2)}\\ &=\frac{2x^2\alpha(1+\alpha^2)^2+32L^2\alpha^3}{(1+\alpha^2)(1-\alpha^2)^2}+\frac{16xL\alpha^2(1-\alpha^2)}{(1+\alpha^2)(1-\alpha^2)^2}\\ &=\frac{2x^2\alpha^5+16xL\alpha^4+(4x^2+32L^2)\alpha^3+16xL\alpha^2+2x^2\alpha}{(1+\alpha^2)(1-\alpha^2)^2}\\ &=\frac{2\alpha(\alpha^2x+4\alpha L+x)^2}{(1+\alpha^2)(1-\alpha^2)^2} \end{align*} The identities that I used were $\sec^2\theta=1+\tan\theta$, $\cos\theta=\frac{1-\tan^2\theta/2}{1+\tan^2\theta/2}$, and $\tan\theta=\frac{2\tan\theta/2}{1-\tan^2\theta/2}$. This seems to be a function that would have a really complex and often multivalued inverse, so I think that I can just say the result is the solution to this equation.$$\frac{kq\,_1q\,_2}{mg}=\tan\theta(x+2L\sin\theta)^2=\frac{2\alpha(\alpha^2x+4\alpha L+x)^2}{(1+\alpha^2)(1-\alpha^2)^2}$$ I guess I can call this more or less answered, then.

-