Quadratic Curve

DOWNLOAD Mathematica Notebook

The general bivariate quadratic curve can be written

 ax^2+2bxy+cy^2+2dx+2fy+g=0.
(1)

Define the following quantities:

Delta=|a b d; b c f; d f g|
(2)
J=|a b; b c|
(3)
I=a+c
(4)
K=|a d; d g|+|c f; f g|.
(5)

Then the quadratics are classified into the types summarized in the following table (Beyer 1987). The real (nondegenerate) quadratics (the ellipse and its special case the circle, hyperbola, and parabola) correspond to the curves which can be created by the intersection of a plane with a (two-nappes) cone, and are therefore known as conic sections.

curveDeltaJDelta/IK
coincident lines000
ellipse (imaginary)!=0>0>0
ellipse (real)!=0>0<0
hyperbola!=0<0
intersecting lines (imaginary)0>0
intersecting lines (real)0<0
parabola!=00
parallel lines (imaginary)00>0
parallel lines (real)00<0

It is always possible to eliminate the xy cross term by a suitable rotation of the axes. To see this, consider rotation by an arbitrary angle theta. The rotation matrix is

[x; y]=[costheta sintheta; -sintheta costheta][x^'; y^']
(6)
=[x^'costheta+y^'sintheta; -x^'sintheta+y^'costheta],
(7)

so

x=x^'costheta+y^'sintheta
(8)
y=-x^'sintheta+y^'costheta
(9)
xy=-x^('2)costhetasintheta+x^'y^'(cos^2theta-sin^2theta)+y^('2)costhetasintheta
(10)
x^2=x^('2)cos^2theta+2x^'y^'costhetasintheta+y^('2)sin^2theta
(11)
y^2=x^('2)sin^2theta-2x^'y^'sinthetacostheta+y^('2)cos^2theta.
(12)

Plugging these into (◇) and grouping terms gives

 x^('2)(acos^2theta+csin^2theta-2bcosthetasintheta)+x^'y^'[2acosthetasintheta-2csinthetacostheta+2b(cos^2theta-sin^2theta)]+y^('2)(asin^2theta+ccos^2theta+2bcosthetasintheta)+x^'(2dcostheta-2fsintheta)+y^'(2dsintheta+2fcostheta)+g=0.
(13)

Comparing the coefficients with (◇) gives an equation of the form

 a^'x^('2)+2b^'x^'y^'+c^'y^('2)+2d^'x^'+2f^'y^'+g^'=0,
(14)

where the new coefficients are

a^'=acos^2theta-2bcosthetasintheta+csin^2theta
(15)
b^'=b(cos^2theta-sin^2theta)+(a-c)sinthetacostheta
(16)
c^'=asin^2theta+2bsinthetacostheta+ccos^2theta
(17)
d^'=dcostheta-fsintheta
(18)
f^'=dsintheta+fcostheta
(19)
g^'=g.
(20)

The cross term 2b^'x^'y^' can therefore be made to vanish by setting

b^'=b(cos^2theta-sin^2theta)-(c-a)sinthetacostheta
(21)
=bcos(2theta)-1/2(c-a)sin(2theta)=0.
(22)

For b^' to be zero, it must be true that

 cot(2theta)=(c-a)/(2b)=K.
(23)

The other components are then given with the aid of the identity

 cos[cot^(-1)(x)]=x/(sqrt(1+x^2))
(24)

by defining

 L=K/(sqrt(1+K^2)),
(25)

so

sintheta=sqrt((1-L)/2)
(26)
costheta=sqrt((1+L)/2).
(27)

Rotating by an angle

 theta=1/2cot^(-1)((c-a)/(2b))
(28)

therefore transforms (◇) into

 a^'x^('2)+c^'y^('2)+2d^'x^'+2f^'y^'+g^'=0.
(29)

Completing the square,

 a^'(x^('2)+(2d^')/(a^')x)+c^'(y^('2)+(2f^')/(c^')y^')+g^'=0
(30)
 a^'(x^'+(d^')/(a^'))^2+c^'(y^'+(f^')/(c^'))^2=-g^'+(d^('2))/(a^')+(f^('2))/(c^').
(31)

Defining x^('')=x^'+d^'/a^', y^('')=y^'+f^'/c^', and g^('')=-g^'+d^('2)/a^'+f^('2)/c^' gives

 a^'x^(''2)+c^'y^(''2)=g^('').
(32)

If g^('')!=0, then divide both sides by g^(''). Defining a^('')=a^'/g^('') and c^('')=c^'/g^('') then gives

 a^('')x^(''2)+c^('')y^(''2)=1.
(33)

Therefore, in an appropriate coordinate system, the general conic section can be written (dropping the primes) as

 {ax^2+cy^2=1   a,c,g!=0; ax^2+cy^2=0   a,c!=0, g=0.
(34)

Consider an equation of the form ax^2+2bxy+cy^2=1 where b!=0. Re-express this using t_1 and t_2 in the form

 ax^2+2bxy+cy^2=t_1x^('2)+t_2y^('2).
(35)

Therefore, rotate the coordinate system

 [x^'; y^']=[costheta sintheta; -sintheta costheta][x; y],
(36)

so

 ax^2+2bxy+cy^2=t_1x^('2)+t_2y^('2) 
=t_1(x^2cos^2theta+2xycosthetasintheta+y^2sin^2theta)+t_2(x^2sin^2theta-2xysinthetacostheta+y^2cos^2theta) 
=x^2(t_1cos^2theta+t_2sin^2theta)+2xycosthetasintheta(t_1-t_2)+y^2(t_1sin^2theta+t_2cos^2theta)
(37)

and

a=t_1cos^2theta+t_2sin^2theta
(38)
b=(t_1-t_2)costhetasintheta=1/2(t_1-t_2)sin(2theta)
(39)
c=t_1sin^2theta+t_2cos^2theta.
(40)

Therefore,

a+c=(t_1cos^2theta+t_2sin^2theta)+(t_1sin^2theta+t_2cos^2theta)
(41)
=t_1+t_2
(42)
a-c=t_1cos^2theta+t_2sin^2theta-t_1sin^2theta-t_2cos^2theta
(43)
=(t_1-t_2)(cos^2theta-sin^2theta)
(44)
=(t_1-t_2)cos(2theta).
(45)

From (39) and (45),

 (a-c)/b=((t_1-t_2)cos(2theta))/(1/2(t_1-t_2)sin(2theta))=2cot(2theta),
(46)

the same angle as before. But

cos(2theta)=cos[cot^(-1)((a-c)/(2b))]
(47)
=cos[tan^(-1)((2b)/(a-c))]
(48)
=1/(sqrt(1+((2b)/(a-c))^2)),
(49)

so

 a-c=(t_1-t_2)/(sqrt(1+((2b)/(a-c))^2)).
(50)

Rewriting and copying (◇),

t_1-t_2=(a-c)sqrt(1+((2b)/(a-c))^2)
(51)
=sqrt((a-c)^2+4b^2)
(52)
t_1+t_2=a+c.
(53)

Adding (52) and (53) gives

t_1=1/2[a+c+sqrt((a-c)^2+4b^2)]
(54)
t_2=a+c-t_1=1/2[a+c-sqrt((a-c)^2+4b^2)].
(55)

Note that these roots can also be found from

 (t-t_1)(t-t_2)=t^2-t(t_1+t_2)+t_1t_2=0
(56)
t^2-t(a+c)+1/4{(a+c)^2-[(a-c)^2+4b^2]}
(57)
=t^2-t(a+c)+1/4[a^2+2ac+c^2-a^2+2ac-c^2-4b^2]
(58)
=t^2-t(a+c)+(ac-b^2)=(a-t)(c-t)-b^2
(59)
=|a-t b; b c-t|=(a-t)(c-t)-b^2=0.
(60)

The original problem is therefore equivalent to looking for a solution to

 [a b; b c][x; y]=t[x; y]
(61)
 [ax bx; by cy][x; y]=t[x^2; y^2],
(62)

which gives the simultaneous equations

 {ax^2+bxy=tx^2   ; bxy+cy^2=ty^2.
(63)

Let X be any point (x,y) with old coordinates and (x^',y^') be its new coordinates. Then

 ax^2+2bxy+cy^2=t_+x^('2)+t_-y^('2)=1
(64)

and

x^'=X^^_+·[x; y]
(65)
y^'=X^^_-·[x; y].
(66)

If t_+ and t_- are both >0, the curve is an ellipse. If t_+ and t_- are both <0, the curve is empty. If t_+ and t_- have opposite signs, the curve is a hyperbola. If either is 0, the curve is a parabola.

To find the general form of a quadratic curve in polar coordinates (as given, for example, in Moulton 1970), plug x=rcostheta and y=rsintheta into (◇) to obtain

 ar^2cos^2theta+2br^2costhetasintheta+cr^2sin^2theta+2drcostheta+2frsintheta+g=0
(67)
 (acos^2theta+2bcosthetasintheta+csin^2theta)+2/r(dcostheta+fsintheta)+g/(r^2)=0.
(68)

Define u=1/r. For g!=0,we can divide through by 2g,

 1/2u^2+1/g(dcostheta+fsintheta)u+1/(2g)(acos^2theta+2bcosthetasintheta+csin^2theta)=0.
(69)

Applying the quadratic formula gives

 u=-d/gcostheta-f/gsintheta+/-sqrt(R),
(70)

where

R=((dcostheta+fsintheta)^2)/(g^2)-4(1/2)(1/(2g))(acos^2theta+2bcosthetasintheta+csin^2theta)
(71)
=(d^2)/(g^2)cos^2theta+(2df)/(g^2)costhetasintheta+(f^2)/(g^2)sin^2theta-1/g(acos^2theta+2bcosthetasintheta+csin^2theta).
(72)

Using the trigonometric identities

sin^2theta=1-cos^2theta
(73)
sin(2theta)=2sinthetacostheta,
(74)

it follows that

R=((d^2)/(g^2)-a/g-(f^2)/(g^2)+c/g)cos^2theta+((df)/(g^2)-b/g)sin(2theta)+((f^2)/(g^2)-c/g)
(75)
=1/2[1+cos(2theta)](d^2-ag-f^2+cg)/(g^2)+sin(2theta)((df-bg)/(g^2))+(f^2-cg)/(g^2)
(76)
=(d^2-ag-f^2+cg)/(2g^2)cos(2theta)+(df-bg)/(g^2)sin(2theta)+(d^2-ag-f^2+cg+2f^2-2cg)/(2g^2).
(77)

Defining

A=-f/g
(78)
B=-d/g
(79)
C=(df-bg)/(g^2)
(80)
D=(d^2-f^2+cg-ag)/(2g^2)
(81)
E=(d^2+f^2-ag-cg)/(2g^2)
(82)

then gives the equation

 u=1/r=Asintheta+Bcostheta+/-sqrt(Csin(2theta)+Dcos(2theta)+E)
(83)

(Moulton 1970). If g=0, then (◇) becomes instead

 u=1/r=-(acos^2theta+2bcosthetasintheta+csin^2theta)/(2(dcostheta+fsintheta)).
(84)

Therefore, the general form of a quadratic curve in polar coordinates is given by

 u={Asintheta+Bcostheta   for g!=0;   +/-sqrt(Csin(2theta)+Dcos(2theta)+E) ; -(acos^2theta+2bcosthetasintheta+csin^2theta)/(2(dcostheta+fsintheta))   for g=0.
(85)

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.