Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Factor.....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71136] Re: Factor.....
  • From: ab_def at prontomail.com
  • Date: Thu, 9 Nov 2006 03:37:50 -0500 (EST)
  • References: <eicnmq$g3i$1@smc.vnet.net><200611060752.CAA08527@smc.vnet.net> <eishcv$nto$1@smc.vnet.net>

In this case equating series terms gives the same result as using
mySolveAlways:

In[2]:= expr = A^4 + 3 + y^2 - (A^2 + a1*A + b1)*(A^2 + a2*A + b2);

In[3]:= Lsol1 = Solve[expr + O[A]^5 == 0, {a1, b1, a2, b2}];
  Lsol2 = List@ ToRules@ Reduce[expr + O[A]^5 == 0, {a1, b1, a2, b2},
    Backsubstitution -> True];
  Lsol3 = mySolveAlways[expr == 0, A, {a1, b1, a2, b2}];
  SameQ @@ Map[Sort, {Lsol1, Lsol2, Lsol3}, 2]

Out[6]= True

I suppose the advantage of the algebraic method is that you don't have
to work out the expansion order. Also sometimes it will succeed when a
series expansion isn't possible, as with mySolveAlways[x^p == x, x]. On
the other hand, the series method is useful for working out identities
like Sin[x] == a1*E^(b1*x) + a2*E^(b2*x).

Maxim Rytin
m.r at inbox.ru

Andrzej Kozlowski wrote:
> In fact, there is no need to define any new function, for this
> particular problem anyway, since you can do this  as easily using the
> already existing ones (and you get more answers as a bonus ;-))
>
> (A^2 + a1*A + b1)*(A^2 + a2*A + b2) //.
> {ToRules[Reduce[LogicalExpand[A^4 + 3 + y^2 == (A^2 + a1*A + b1)*(A^2
> + a2*A + b2) + O[A]^4],
> {a1, a2, b1, b2}]]}
>
> {(A^2 - Sqrt[-y^2 - 3])*(A^2 + Sqrt[-y^2 - 3]), (A^2 - Sqrt[-y^2 - 3])
> *(A^2 + Sqrt[-y^2 - 3]),
> (A^2 - Sqrt[2]*(y^2 + 3)^(1/4)*A + Sqrt[y^2 + 3])*(A^2 + Sqrt[2]*(y^2
> + 3)^(1/4)*A + Sqrt[y^2 + 3]),
> (A^2 - I*Sqrt[2]*(y^2 + 3)^(1/4)*A - Sqrt[y^2 + 3])*(A^2 + I*Sqrt[2]*
> (y^2 + 3)^(1/4)*A -
> Sqrt[y^2 + 3]), (A^2 - I*Sqrt[2]*(y^2 + 3)^(1/4)*A - Sqrt[y^2 + 3])*
> (A^2 + I*Sqrt[2]*(y^2 + 3)^(1/4)*A - Sqrt[y^2 + 3]),
> (A^2 - Sqrt[2]*(y^2 + 3)^(1/4)*A + Sqrt[y^2 + 3])*(A^2 + Sqrt[2]*(y^2
> + 3)^(1/4)*A + Sqrt[y^2 + 3])}
>
>
> ExpandAll[%]
>
>
> {A^4 + y^2 + 3, A^4 + y^2 + 3, A^4 + y^2 + 3, A^4 + y^2 + 3, A^4 +
> y^2 + 3, A^4 + y^2 + 3}
>
> Andrzej Kozlowski
> Tokyo, Japan
>
> On 6 Nov 2006, at 16:52, ab_def at prontomail.com wrote:
>
> > Along the same lines, we can define an extended SolveAlways function
> > taking a third argument that specifies which parameters to solve for:
> >
> > mySolveAlways[$Leq_, $Lvar_, $Lpar_ : {}] := Module[
> >   {Leq = $Leq, Lvar = $Lvar, Lpar = $Lpar, ans},
> >   {Leq, Lvar, Lpar} = If[ListQ@ #, #, {#}]& /@
> >     {Leq, Lvar, Lpar};
> >   ans = Solve[!Eliminate[!And @@ Leq, Lvar], Lpar];
> >   Select[ans, FreeQ[#, Alternatives @@ Lvar]&] /;
> >     Head@ ans =!= Solve
> > ]
> >
> > In[2]:= (A^2 + a1*A + b1)*(A^2 + a2*A + b2) /.
> >   Last@ mySolveAlways[
> >     A^4 + 3 + y^2 == (A^2 + a1*A + b1)*(A^2 + a2*A + b2),
> >     A, {a1, b1, a2, b2}]
> >
> > Out[2]= (A^2 - Sqrt[2]*A*(3 + y^2)^(1/4) + Sqrt[3 + y^2])*(A^2 +
> > Sqrt[2]*A*(3 + y^2)^(1/4) + Sqrt[3 + y^2])
> >
> > Maxim Rytin
> > m.r at inbox.ru
> >
> > dh wrote:
> >> Hi,
> >>
> >> you have to tell Mathematica what form you want.
> >>
> >> Assume e.g. that we want the form (A^2 + a1 A + a0)(A^2 + b1 A + b0).
> >>
> >> Then we expand, equate the coefficients of A and solve for
> >> a0,a1,b0,b1:
> >>
> >> r1=CoefficientList[(A^2+A a1+a0)(A^2+b1 A+ b0)//Expand,A]
> >>
> >> r2=CoefficientList[A^4+3+y^2,A]
> >>
> >> Solve[Thread[r1==r2],{a0,a1,b0,b1}]
> >>
> >> this gives several possible expansions.
> >>
> >>
> >>
> >> Daniel
> >>
> >>
> >>
> >> gtsavdar at auth.gr wrote:
> >>
> >>> How can i factor A^4 + 3 + y^2 (A,y reals) for example with
> >>
> >>> Mathematica.....?
> >>
> >>>
> >>
> >>>
> >>
> >>> (
> >>
> >>> In order to have:
> >>
> >>> (A^2 + SQRT(y^2+3) + A·SQRT(2*SQRT(y^2+3))) · (A^2 + SQRT(y^2+3) -
> >>
> >>> A·SQRT(2*SQRT(y^2+3)))
> >>
> >>> )
> >>
> >>>
> >>
> >>> (
> >>
> >>> OR:
> >>
> >>> (y^2 - i·SQRT(A^4+3)) · (y^2 + i·SQRT(A^4+3))
> >>
> >>> )
> >>
> >>>
> >>
> >>>
> >>
> >>> Thanks....
> >>
> >>>
> >


  • Prev by Date: Re: Merge of Matrices
  • Next by Date: Re: Efficiency of repeatedly appending to a List
  • Previous by thread: Re: Re: Factor.....
  • Next by thread: Re: Factor.....