MathGroup Archive 2006

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

Search the Archive

Re: Factor.....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71025] Re: Factor.....
  • From: ab_def at prontomail.com
  • Date: Mon, 6 Nov 2006 02:52:20 -0500 (EST)
  • References: <eicnmq$g3i$1@smc.vnet.net><eieq1b$l7h$1@smc.vnet.net>

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: Lists and polynomials
  • Next by Date: Assuming non-integer values in Mathematica simplifications
  • Previous by thread: Re: Factor.....
  • Next by thread: Re: Re: Factor.....