1
$\begingroup$

Newbie question, couldn't find an exact dupe.

I'm expecting that with these assumptions

$Assumptions = 
Subscript[v, 1] \[Element] Complexes && 
Subscript[v, 2] \[Element] Complexes && 
Subscript[v, 3] \[Element] Complexes && 
Sqrt[Subscript[v, 1]^2 + Subscript[v, 2]^2 + Subscript[v, 3]^2] == 1

The following would be equal to 1

FullSimplify[
  Sqrt[Subscript[v, 1]^2 + Subscript[v, 2]^2 + Subscript[v, 3]^2]]

However, I get back

$\sqrt{v_1^2+v_2^2+v_3^2}$

Why?

----- Edit: A simpler version of the question:

Why does the following

FullSimplify[Sqrt[x + y], Assumptions -> Sqrt[x + y] == 1]

evaluate to

Sqrt[x + y]

instead of $1$?

$\endgroup$
  • 4
    $\begingroup$ A simpler example is FullSimplify[Sqrt[x + y], Assumptions -> Sqrt[x + y] == 1] which returns Sqrt[x + y]. $\endgroup$ – Nasser Dec 2 '18 at 1:12
  • 1
    $\begingroup$ TIP: don't use subscripts. $\endgroup$ – AccidentalFourierTransform Dec 2 '18 at 1:23
  • $\begingroup$ subscripts don't make a difference! $\endgroup$ – Balint Pato Dec 2 '18 at 1:52
  • $\begingroup$ @Nasser that's true, is this expected behavior? Maybe I'm missing something around how Simplify should work? $\endgroup$ – Balint Pato Dec 2 '18 at 1:53
2
$\begingroup$

I could be wrong, but I think in general you cannot use assumptions to say that an entire expression is equivalent to another value. Even if you could, Mathematica doesn't necessarily know that it should replace your Sqrt with 1 - they're equivalent so why not leave it as is?

If you know that you specifically want to replace your Sqrt with another value, I would recommend:

1 + Sqrt[Subscript[v, 1]^2 + Subscript[v, 2]^2 + 
Subscript[v, 3]^2] /. 
 Sqrt[Subscript[v, 1]^2 + Subscript[v, 2]^2 + Subscript[v, 3]^2] -> 1

This evaluates to 2, as expected.

If you have several of these, you can set them up at the beginning like this:

rules = {a -> b, c -> d, e -> f};
myequation = a^2 + c^2 + e^2;
myequation/.rules

This yields b^2 + d^2 + f^2.

$\endgroup$
0
$\begingroup$

Simplify and FullSimplify work better with polynomial equations, so why not use:

Simplify[Sqrt[x+y], x+y==1]

1

or:

Simplify[
    Sqrt[Subscript[v,1]^2+Subscript[v,2]^2+Subscript[v,3]^2],
    Subscript[v,1]^2+Subscript[v,2]^2+Subscript[v,3]^2==1
]

1

$\endgroup$
0
$\begingroup$
Solve[{y==Sqrt[v1^2+v2^2+v3^2],Sqrt[v1^2+v2^2+v3^2]==1},y]
(* {{y->1}} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.