       Re: Thread function now working as expected

• To: mathgroup at smc.vnet.net
• Subject: [mg74612] Re: [mg74587] Thread function now working as expected
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Wed, 28 Mar 2007 01:43:26 -0500 (EST)
• Reply-to: hanlonr at cox.net

```eqn1 = Sqrt[1+196*x^4] == 12*x-1-14*x^2;

To square both sides of an equation just use Map (/@)

eqn2 = #^2& /@ eqn1

196*x^4 + 1 == (-14*x^2 + 12*x - 1)^2

To expand both sides of an equation use ExpandAll

eqn3 = eqn2//ExpandAll

196*x^4 + 1 == 196*x^4 - 336*x^3 + 172*x^2 - 24*x + 1

eqn3//Simplify

x*(84*x^2 - 43*x + 6) == 0

However, you do not need to expand eqn2 to get this result

eqn2//Simplify

x*(84*x^2 - 43*x + 6) == 0

Bob Hanlon

---- siewsk at bp.com wrote:
> I cannot get the Thread function to work on In and I
> am forced to do it manually in In
>
> Does anyone has any idea why In is not working as I expected?
>
> In:= eqn1 = Sqrt[1 + 196*x^4] == 12*x - 1 - 14*x^2
> Out=
>               4                     2
> Sqrt[1 + 196 x ] == -1 + 12 x - 14 x
>
>
> In:= eqn2 = Thread[(#1^2 & )[eqn1], Equal]
> Out=
>          4                     2 2
> 1 + 196 x  == (-1 + 12 x - 14 x )
>
>
> In:= dummy = Thread[Expand[eqn2], Equal]
> Out=
>          4                     2 2
> 1 + 196 x  == (-1 + 12 x - 14 x )
>
>
> In:= eqn3 = Equal[ eqn2[] , Expand[ eqn2[] ]  ]
> Out=
>          4                    2        3        4
> 1 + 196 x  == 1 - 24 x + 172 x  - 336 x  + 196 x
>
>
> In:= Simplify[eqn3]
> Out=
>                   2
> x (6 - 43 x + 84 x ) == 0
>
>

```

• Prev by Date: Re: Thread function now working as expected
• Next by Date: Re: Thread function now working as expected
• Previous by thread: Re: Thread function now working as expected
• Next by thread: Re: Thread function now working as expected