# 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

• For what purpose are you trying to invert it? You are likely making things far harder than they need to be. – user14972 May 20 '16 at 0:11
• I'm trying to integrate to evaluate this integral: $\int_{y_0}^{y_1} f(y) \frac{dx}{dy} dy$, for some exponentialy decaying f. I tried writing it as $\int f(y(x)) dx$ but then I'm still left with the boundries. – Piotr Benedysiuk May 20 '16 at 10:37

$$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.

• Christ, you really put in some work for me! Thank you. How did you get equation for k? You mention cubic polynomials but I'm unsure how you get to them. No need to write the "after some work" part. Also for the LHS - if I square $(x^2 + 2l)^2 = x^4 + 4lx^2 + 4l^2$ so it doesn't quite come out. Anyhow thanks again, I didn't even think about making them a perfect square! – Piotr Benedysiuk May 19 '16 at 23:45
• @PiotrBenedysiuk You have 4 equations for $k,l,m,n$, (around the LHS,RHS and slightly above area) solve by substitutions repeatedly until you isolate $k$. And if I made a few mistakes, it should be expected. It wasn't easy keeping track of all the variables. – Simply Beautiful Art May 19 '16 at 23:53
• Making it a square is just the easiest way to explain the quartic formula, which I didn't want to type up. Typing the explicit formula is probably harder than explaining how you get there. – Simply Beautiful Art May 19 '16 at 23:57
• Fixed it anyways. – Simply Beautiful Art May 20 '16 at 0:16