MathGroup Archive 1998

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

Search the Archive

Re: Need help for a simple equation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg12832] Re: [mg12813] Need help for a simple equation
  • From: Daniel Lichtblau <danl>
  • Date: Fri, 12 Jun 1998 18:15:10 -0400
  • References: <199806120805.EAA24568@smc.vnet.net.>
  • Sender: owner-wri-mathgroup at wolfram.com

Tae-Wan Kim wrote:
> 
> Hello,
> 
> I need your help to solve a simple equation.
> 
> My problem is as follows:
> f(x, y) = a x^2 + b xy + c y^2 + d x + e y + f = 0 (1)
> 
> partial derivative of f(x,y) with respect to x: dfx(x, y) = 2 a x + b y
> + d = 0 (2)
> 
> I'd like to solve (1) and (2) using Mathematica.
> 
> I get two set of roots:
> (x_0, y_0) and (x_1, y_1)
> 
> I programmed as sollows:
> SetAttributes[a, Constant]
> SetAttributes[b, Constant]
> SetAttributes[c, Constant]
> SetAttributes[d, Constant]
> SetAttributes[e, Constant]
> SetAttributes[f, Constant]
> f[x_, y_] := a x^2 + b xy + c y^2 + d x + e y + f
> 
> dfx = D[f[x,y], x]
> -> this didn't work
> 
> I don't know what to do here.
> 
> Could you please tell me Mathematics program to solve this problem?
> 
> Thank you.
> 
> Best regards,
> 
> Tae-wan Kim
> SDRC

The devil is in the details. First problem: "xy" is not the same as
"x*y". Second (minor) problem: it is dangerous practice to use the same
symbol in two different ways. This applies to "f" in your definition.

For the particular stated purpose there is really no need to define a
"function" f so I'll change this a bit as well.

In[19]:= fxy = a*x^2 + b*x*y + c*y^2 + d*x + e*y + g;

In[20]:= dfx = D[fxy,x]
Out[20]= d + 2 a x + b y

In[21]:= Solve[{fxy,dfx}==0, {x,y}] // InputForm Out[21]//InputForm=
{{x -> (-d - (b^2*d)/(-b^2 + 4*a*c) + (2*a*b*e)/(-b^2 + 4*a*c) -
     (2*Sqrt[a]*b*Sqrt[c*d^2 - b*d*e + a*e^2 + b^2*g - 4*a*c*g])/
      (-b^2 + 4*a*c))/(2*a),
  y -> (b*d - 2*a*e + 2*Sqrt[a]*Sqrt[c*d^2 - b*d*e + a*e^2 + b^2*g -
        4*a*c*g])/(-b^2 + 4*a*c)},
 {x -> (-d - (b^2*d)/(-b^2 + 4*a*c) + (2*a*b*e)/(-b^2 + 4*a*c) +
     (2*Sqrt[a]*b*Sqrt[c*d^2 - b*d*e + a*e^2 + b^2*g - 4*a*c*g])/
      (-b^2 + 4*a*c))/(2*a),
  y -> (b*d - 2*a*e - 2*Sqrt[a]*Sqrt[c*d^2 - b*d*e + a*e^2 + b^2*g -
        4*a*c*g])/(-b^2 + 4*a*c)}}


Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Exporting lists from Mathematica 3.0 to Excel
  • Next by Date: Position on a List
  • Previous by thread: Need help for a simple equation
  • Next by thread: Re: Need help for a simple equation