3
$\begingroup$

This is maybe the worst type of question because it is super specific, but I am hoping that some Mathematica function or rule exists (built-in or custom) that can be helpful for simplifying a somewhat broad class of expressions involving square roots. Here is an example expression of the type I am trying to simplify:

2*s^2*(-1 + v^2) + 2*s*(-Sqrt[1 - v^2 + 2*s*(s - Sqrt[1 + s^2 - v^2])] + Sqrt[1 - v^2 + 2*s*(s + Sqrt[1 + s^2 - v^2])]) - (1 + v^2)*(-2 + 2*v^2 + Sqrt[(-1 - s^2 + v^2)*(-1 + v^2 + 2*s*(-s + Sqrt[1 + s^2 - v^2]))] + Sqrt[(1 + s^2 - v^2)*(1 - v^2 + 2*s*(s + Sqrt[1 + s^2 - v^2]))])

where 0<v<1 and -v<s<v. Numerical evaluation suggests the above expression vanishes within those assumed ranges, but even with Assuming[] in Mathematica I was unable to arrive at a satisfactory simplification. I tried FullSimplify[] and many other related functions without success. Thoughts on possible simplification tools? I have a few cases like this to deal with where many do not vanish, and I am hoping that those non-vanishing expressions can be simplified extensively considering that the above example is similar and vanishes.

$\endgroup$

1 Answer 1

2
$\begingroup$

I propose an initial manual simplification. Replace 1 + s^2 - v^2 by r^2, which is best done by replacing v^2:

v^2 -> 1 + s^2 - r^2

You can use Reduce to get new assumptions —— or you can just bite the bullet and think :) —— I did the former:

Reduce[r > 0 && r^2 == 1 + s^2 - v^2 && 
  0 < v < 1 && -v < s < v, {v}, Reals]

(*  0 < r < 1 && -r < s < r && v == Sqrt[1 - r^2 + s^2]  *)

The first two conditions are used in Simplify:

new = 2*s^2*(-1 + v^2) + 
    2*s*(-Sqrt[1 - v^2 + 2*s*(s - Sqrt[1 + s^2 - v^2])] + 
       Sqrt[1 - v^2 + 2*s*(s + Sqrt[1 + s^2 - v^2])]) - (1 + 
       v^2)*(-2 + 2*v^2 + 
       Sqrt[(-1 - s^2 + v^2)*(-1 + v^2 + 
           2*s*(-s + Sqrt[1 + s^2 - v^2]))] + 
       Sqrt[(1 + s^2 - v^2)*(1 - v^2 + 
           2*s*(s + Sqrt[1 + s^2 - v^2]))]) /. 
   v^2 -> 1 + s^2 - r^2;
Simplify[new, 0 < r < 1 && -r < s < r]

(*  0  *)
$\endgroup$
1
  • $\begingroup$ This replacement works pretty well not only for this case but also for other similar cases, thanks! $\endgroup$ Commented Jun 29, 2021 at 22:41

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.