|
[Date Index]
[Thread Index]
[Author Index]
RE: Coefficient problem
- To: mathgroup at smc.vnet.net
- Subject: [mg36435] RE: [mg36421] Coefficient problem
- From: "DrBob" <drbob at bigfoot.com>
- Date: Sat, 7 Sep 2002 02:53:41 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
This works:
eq = a x^2 + b x + c
discriminant[eq_, x_] := Coefficient[eq, x]^2 - 4 Coefficient[eq,
x, 2] Coefficient[eq, x, 0]
discriminant[eq, x]
x^0 is reduced to 1 and the Coefficient of 1 doesn't make sense to
Mathematica, because it depends on what the variable is (a, b, c, or
x?). So, the other form of the Coefficient call is needed. I used it
for the second power too, but that wasn't necessary. I think that form
is best, though, since it allows no ambiguity.
I renamed the function because that's what the quantity is often called,
for a quadratic.
Bobby Treat
-----Original Message-----
From: CeZaR [mailto:pascal at go.ro]
To: mathgroup at smc.vnet.net
Subject: [mg36435] [mg36421] Coefficient problem
Hi,
Now I'm trying to calculate this formula:
Delta[eq_, x_]:=Coefficient[eq, x]^2 - 4 Coefficient[eq, x^2]
Coefficient[eq, x^0]
eq has this form a x^2 + b x + c
But there is a problem with the x^0 coefficient!
How can I overcome that?
Thanks!
CeZaR
Prev by Date:
Re: Plotting The Slope field of a differential equation
Next by Date:
Re: word processing with mathematica
Previous by thread:
Re: Coefficient problem
Next by thread:
First time help browser
|