MathGroup Archive 2009

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

Search the Archive

Re: Using Coefficient on an equation


Carlos, here may be what you're looking for:

In[1]:= f=a*x^2+b*x+c==0
Out[1]= c+b x+a x^2==0

In[2]:= Coefficient[f,x^2]
Out[2]= 0

In[3]:= Coefficient[f[[1]],x^2]
Out[3]= a



On Sun, 18 Jan 2009, carlos at colorado.edu wrote:

> If f=a*x^2+b*x+c, Coefficient[f,x^2] obviously returns a.
> But if f=a*x^2+b*x+c==0, it returns 0.
>
> The problem arose using the Calculus`VariationalMethods` package.
> It (unfortunately) returns the Euler-Lagrange equations as
> such, so I have to remove the useless ==0 appendage for
> Coefficient to work properly. Is there a simple direct way out?
>
>


  • Prev by Date: Re: Using Coefficient on an equation
  • Next by Date: Re: usage of TrigToExp?
  • Previous by thread: Re: Using Coefficient on an equation
  • Next by thread: Re: Using Coefficient on an equation