# Why would Solve fail to give a valid inverse?

I have the following function:

$$y = \frac{8+10x^2+x^4+6x\sqrt{6+x^2}+x^3\sqrt{6+x^2}}{8+x^2}$$

Using the following Mathematica command to find the inverse,

Solve[y == (8 + 10 x^2 + x^4 + 6 x Sqrt[6 + x^2] + x^3 Sqrt[6 + x^2])/(8 + x^2), x]


I get four outputs for x. They take almost the same form:

$$x=\pm\frac{1}{2}\sqrt{-\frac{8}{-1+y}-\frac{20y}{-1+y}+\frac{y^2}{-1+y}\pm\frac{\sqrt{y}(8+y)^{3/2}}{-1+y}}$$

Four outputs is correct, since the original equation is a quartic equation. However all four solutions are undefined for $$y = 1$$. This doesn't make sense, since from the first equation there's obviously a value of $$x$$ that gives $$y=1$$: zero ($$x=0$$).

What is going on here? Is Mathematica failing to find the inverse?

If it matters, the function $$y$$ looks like this:

The four inverse functions look like this:

The original function clearly corresponds to the blue curve + green curve (up to 1) + orange curve (after 1), so Mathematica is finding some of the inverse; however there are extra curves that I'm not sure what to make of.

You are looking only for real solutions, so you should restrict Solve:

Solve[y == (8 + 10 x^2 + x^4 + 6 x Sqrt[6 + x^2] + x^3 Sqrt[6 + x^2])/(8 + x^2), x, Reals]


gives two real (not four) solution branches as expected.

It seems that Solve (without restricting reals) expands the soultion range by transforming(squaring the roots) the equation to (y (8 + x^2) - (8 + 10 x^2 + x^4))^2 == (6 x + x^3)^2 (6 + x^2)

ContourPlot[(y (8 + x^2) - (8 + 10 x^2 + x^4))^2 == (6 x + x^3)^2 (6 +x^2), {x, -10, 10}, {y, 0, 10}, FrameLabel -> {x, y}]


• Wait, aren't the four x's already found all real? Why does restricting x change the answer then? Commented Nov 12, 2018 at 11:19
sol = Solve[
y == (8 + 10 x^2 + x^4 + 6 x Sqrt[6 + x^2] + x^3 Sqrt[6 + x^2])/(8 + x^2), x];


The domains for which these are real-valued are

FunctionDomain[#, y] & /@ (x /. sol)

(* {0 <= y < 1, 0 <= y < 1, 0 <= y < 1 || y > 1, 0 <= y < 1 || y > 1} *)


Looking at the Limit as y approaches 1

Limit[x /. sol, y -> 1]

(* {Indeterminate, Indeterminate, 0, 0} *)


So two of the solutions (third and fourth) are defined in the limit at y == 1

Plot[Evaluate[x /. sol], {y, 0, 2},
PlotStyle -> {{Red, Dashed}, {Blue, Dashed}, Blue, Red},
PlotLegends -> Automatic,
PlotRange -> {-10, 10}]