       Re: Thread function now working as expected

• To: mathgroup at smc.vnet.net
• Subject: [mg74623] Re: Thread function now working as expected
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Wed, 28 Mar 2007 04:36:23 -0500 (EST)
• References: <euan64\$do9\$1@smc.vnet.net>

```Copy paste the following as a whole cell in a notebook select the cell
and execute it.

In:=
eqn = Sqrt[1 + 196*x^4] == 12*x - 1 - 14*x^2
Print["square both sides"]
(#1^2 & ) /@ %%
Print["Expand both sides"]
Expand /@ %%
Print["final equation"]
(Plus[#2 - #1] & ) @@ %% == 0
Print["product of factors"]
Factor /@ %%
Print["set each factor equal to zero"]
%%[] /. (a_)*(b_)*(c_Plus) -> a*b == 0 && c == 0
Print["solution"]
(Solve[#1, x] & ) /@ %%
Print["verification"]
Block[{Message}, FullSimplify[eqn /. Flatten[List @@ %%, 1]]]
Print["solution of eqn by Mathematica directly"]
Reduce[eqn, x]
{ToRules[%]}

The extreneous root x=0 is due to the process of squaring.

In:=
(Solve[eqn, x, VerifySolutions -> #1] & ) /@ {True, False}

Out=
{{{x -> (1/168)*(43 - I*Sqrt)}, {x -> (1/168)*(43 +
I*Sqrt)}}, {{x -> 0}, {x -> (1/168)*(43 - I*Sqrt)},
{x -> (1/168)*(43 + I*Sqrt)}}}

Regards
Dimitris

=CF/=C7 siewsk at bp.com =DD=E3=F1=E1=F8=E5:
> 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: Is this a problem in mathematica? (2nd)
• Next by Date: Re: Is this a problem in mathematica?