Algebra deduction?

I was trying to use Mathematica for some simple algebra deduction, but it didnt work. code:

TrueQ@(Sqrt[(e0 u0)/(e1 u1)] == Sqrt[e0 u0]/Sqrt[e1 u1])


Any ideas how to make Mathematica know these equations are the same?

• TrueQ is not usually used this way. Suppose you have a condition (e.g., A == B as in your case). There are three possibilities: it computes to True, it computes to False, and its value cannot be computed. The function If[] for instance does different things in each case. TrueQ is used to force the last case to be False. It is used for programming and not for mathematics. If you have a procedure that should not be executed unless it is known that the condition is true, then TrueQ is convenient to combine the False and the undecided cases together. Commented Nov 2, 2019 at 16:50

You need to assume e1,u1 are positive

Assuming[e1 > 0 && u1 > 0, Simplify[Sqrt[(e0 u0)/(e1 u1)] - Sqrt[e0 u0]/Sqrt[e1 u1]]]


Let look and see why. Consider the simple example

Clear[x]
expr = Sqrt[1/x] - 1/Sqrt[x];
Simplify[expr]


If x is negative, then Sqrt[1/x] is Sqrt[-1/Abs[x]] which is I*Sqrt[1/Abs[x]] which is not the same as 1/Sqrt[x]. But if x>0 then Sqrt[1/x]=1/Sqrt[x]

Assuming[x > 0, Simplify[expr]]
(* 0 *)


And that is what happened in your expression.

• But if I try Assuming[e1 > 0 && u1 > 0, TrueQ[Sqrt[(e0 u0)/(e1 u1)] == Sqrt[e0 u0]/Sqrt[e1 u1]]] it still gives False Commented Oct 3, 2019 at 2:44
• Yep, changed to Simplify and it worked. Thanks Commented Oct 3, 2019 at 2:53
• Also, I think TrueQ is really meant for structural sameness. Not Math-wise sameness. i.e. when both sides are exactly the same structurally. Any way, I normally just use Simplify when Assuming. Commented Oct 3, 2019 at 2:54
• For example, TrueQ[Exp[I x] == Cos[x] + I*Sin[x]] gives False but Simplify[Exp[I x] == Cos[x] + I*Sin[x]] gives True Commented Oct 3, 2019 at 3:10
• This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review Commented Oct 3, 2019 at 3:52