# Function FullSimplify unable to simplify relatively simple algebraic expression

I want to simplify with Mathematica 11 the following algebraic expression under the assumptions $x<0$ and $y>0$:

A= (-x + Sqrt[x^2 + y])/Sqrt[2 x^2 + y - 2 x Sqrt[x^2 + y]]


A short calculation yields A = 1. But Mathematica seems not able to obtain that result when the following expression is evaluated:

FullSimplify[A,Assumptions->x<0&&y>0]


Is it possible to help Mathematica to solve this?

• What is that "short calculation " that yields A = 1? Sep 22 '17 at 13:16
• You can complete the square in the denominator, explicitly: 2x^2 + y - 2 x Sqrt[x^2+y] = (-x + Sqrt[x^2 + y])^2
– Flo
Sep 22 '17 at 13:20
• Strange indeed. Simplify[A == 1, ...] and Simplify[A^2, ...] both work. You could use the latter to figure out that the result must be either 1 or -1, and the former to show that it is always 1. Sep 22 '17 at 13:24
• Even this works: Reduce[A == z, {x, y}, Reals]. Sep 22 '17 at 13:26
• Thanks for looking into it. My problem is that A is part of a much bigger expression and I rely on FullSimplify to correctly simplify it. And I want to avoid using replacement rules, which wouldn't be elegant.
– Flo
Sep 22 '17 at 13:28

One possibility is to add Reduce to the list of TransformationFunction rules. For example:

oneReduce[x_] := If[TrueQ @ !Reduce[{x != 1, $Assumptions}], 1, x]  If Reduce can determine that x != 1 is definitely False based on $Assumptions, then it transforms x to 1. Let's see this in action:

Assuming[x<0 && y>0, Simplify[A, TransformationFunctions->{Automatic, oneReduce}]]


1

Another useful transformation function is:

zeroReduce[x_] := If[TrueQ @ !Reduce[{x != 0, \$Assumptions}], 0, x]


Perhaps this approach will work with more complicated expressions.

• That's definitely an elegant and useful solution. In my case computationally too expensive though.
– Flo
Sep 22 '17 at 15:04