       Re: Problems with simplify and Sqrt[a^2]

• To: mathgroup at smc.vnet.net
• Subject: [mg73977] Re: Problems with simplify and Sqrt[a^2]
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Sat, 3 Mar 2007 23:55:28 -0500 (EST)
• References: <es907e\$2b4\$1@smc.vnet.net>

```=CF/=C7 dshortho =DD=E3=F1=E1=F8=E5:
> any help on this one:
>
> if you type in:
> v3/Sqrt[v1^2]/Sqrt[v2^2] - v3/v1/v2
>
> you get the same expression
>
> Even if you then type
> Simplify[%]
>
> you still get the same expression
>
> I would have thought Mathematica would have resolved Sqrt[v1^2] to v1 (!?)
>
> Does anyone out there know why it does not do this, as it is causing some=
problems with some proofs I am doing ?

Are you sure that Sqrt[v1^2] and v1 are the same for all values of v1?

In:=
(Sqrt[#1^2] - #1 & ) /@ {-2, -3, 0, 4, 5, 3 + I, 3 - I, I, -3 + I, -5
+ 9*I}
Out=
{4, 6, 0, 0, 0, 0, 0, 0, 6 - 2*I, 10 - 18*I}

Mathematica by default assumes that the variables are complex.
As you see Sqrt[v1^2]-v1=0 is true only for Re[v1]>0.

So

In:=
Simplify[Sqrt[v1^2] - v1, Re[v1] > 0]
Out=
0

Or

In:=
PowerExpand[Sqrt[v1^2] - v1]
Out=
0

but be careful with its use!
Read before proceeding to any applications the relevant material from
the Help Browser.

If you deal with cases like this frequently then you can add this
assumption (that is, Re[v]>0)
as follows

Then

In:=
\$Assumptions = {Re[v1] > 0 && Re[v2] > 0}
Out=
{Re[v1] > 0 && Re[v2] > 0}

In:=
Simplify[v3/Sqrt[v1^2]/Sqrt[v2^2] - v3/v1/v2]
Out=
0

as you wish!

To restore the default setting execute

In:=
\$Assumptions = {}
Out=
{}

Dimitris

```

• Prev by Date: Re: GenerateConditions->False gives fine result!
• Next by Date: Re: Bug with Limit?
• Previous by thread: Re: Problems with simplify and Sqrt[a^2]
• Next by thread: Re: Problems with simplify and Sqrt[a^2]