<s>[INST] Inverse of almost quadratic functions Hi all first question here,
I'm currently trying to invert the following two (two since the $\pm$ sign) functions:
$y = x^2 \pm \sqrt{(ax + b \sin{\theta})^2 + (b\cos{\theta})^2}$ 
Where a,b, $\theta$ are real and positive.
I tried banging my head against the wall and using Maple, but Maple gives me answers in terms of RootOf and _Z(yes lower case _ and then Z) which I interpreted as "go away". Then again I'm bad at Maple.
I'm aware that the global inverse doesn't exist but locally I should be able to find something right?
For case $\theta = 0$ I currently have two non-global inverses in the form of:
$x = \frac{1}{2} \sqrt{2} \sqrt{a^2 + 2y \pm \sqrt{a^4 +4 a^2 y + 4 b^2}}$
(Note that this only inverts to positive x but for $\theta = 0$ the function is symmetric in 0.)
Any help, direction or solution is appreciated.
Cheers,
Piotr 
 [/INST] $$y-x^2=\pm\sqrt{(ax+b\sin\theta)^2+(b\cos\theta)^2}$$
$$(y-x^2)^2=(ax+b\sin\theta)^2+(b\cos\theta)^2$$
$$y^2-2x^2y+x^4=ax^2+2ab\sin\theta x+b^2(\sin^2\theta+\cos^2\theta)$$
$sin^2\theta+\cos^2\theta=1$
$$y^2-2x^2y+x^4=ax^2+2ab\sin\theta x+b^2$$
$$x^4-2(y+a)x^2-2ab\sin\theta x+y^2-b^2=0$$
$$x^4+kx^2+l=mx^2+2ab\sin\theta x+n$$
Where $m-k=2(y+a)$ and $l-n=y^2-b^2$.
To make the LHS a perfect square, I also want the relationship $k^2=4l$,
$$x^4+kx^2+l=(x^2+\sqrt{l})^2$$
To make the RHS a perfect square, I want the relationship $\sqrt{mn}=ab\sin\theta$,
$$mx^2+2ab\sin\theta x+n=(\sqrt mx+\sqrt n)^2$$
This allows us to set the two equal and square root both sides, followed by an application of the quadratic formula.
To solve for $k,l,m,n$, we must solve cubic polynomials, which is doable.
After some work, we can get
$$\frac14k^3+\frac{y+a}2k^2-(y^2-b^2)k-2(y+a)(y^2-b^2)-(ab\sin\theta)^2=0$$
Using the cubic formula, we get
$$k=\left(\frac{\sqrt3}2-\frac12i\right)^{1,2,3}\left(\sqrt[3]{q+\sqrt{q^2+(r-p^2)^3}}+\sqrt[3]{q-\sqrt{q^2+(r-p^2)^3}}\right)+p$$
Where $p=-\frac{2(y+a)}{3}$, $q=p^3+\frac{-4(y+a)2(y^2-b^2)+6(2(y+a)(y^2-b^2)-(ab\sin\theta)^2)}{3}$, and $r=\frac{4(b^2-y^2)}3$.
You can quickly see how this becomes excruciatingly painful?  I don't even write the value of $k$ outright, I use extra variables all over the place!  And there are three solutions for $k$, where we have $1,2,3$ in the exponent.  (Kind of like the plus minus of the quadratic formula but we have three different solutions)
If you really wanted to, you could try and solve for the other variables now that you have $k$.  Then you can set the two binomials equal and cancel the square roots (adding in $\pm$ when you cancel them) and then apply quadratic formula.
It is too tedious to do, which is why I won't do it.  I hope I left a good enough explanation that you could do it, if you really really wanted to try, and feel free to leave a comment if you are confused on anything.
</s>