owned this note
owned this note
Published
Linked with GitHub
# 二次曲線

This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
$\newcommand{\trans}{^\top}
\newcommand{\adj}{^{\rm adj}}
\newcommand{\cof}{^{\rm cof}}
\newcommand{\inp}[2]{\left\langle#1,#2\right\rangle}
\newcommand{\dunion}{\mathbin{\dot\cup}}
\newcommand{\bzero}{\mathbf{0}}
\newcommand{\bone}{\mathbf{1}}
\newcommand{\ba}{\mathbf{a}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\bc}{\mathbf{c}}
\newcommand{\bd}{\mathbf{d}}
\newcommand{\be}{\mathbf{e}}
\newcommand{\bh}{\mathbf{h}}
\newcommand{\bp}{\mathbf{p}}
\newcommand{\bq}{\mathbf{q}}
\newcommand{\br}{\mathbf{r}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}
\newcommand{\bu}{\mathbf{u}}
\newcommand{\bv}{\mathbf{v}}
\newcommand{\bw}{\mathbf{w}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\nul}{\operatorname{null}}
\newcommand{\rank}{\operatorname{rank}}
%\newcommand{\ker}{\operatorname{ker}}
\newcommand{\range}{\operatorname{range}}
\newcommand{\Col}{\operatorname{Col}}
\newcommand{\Row}{\operatorname{Row}}
\newcommand{\spec}{\operatorname{spec}}
\newcommand{\vspan}{\operatorname{span}}
\newcommand{\Vol}{\operatorname{Vol}}
\newcommand{\sgn}{\operatorname{sgn}}
\newcommand{\idmap}{\operatorname{id}}$
```python
from lingeo import random_int_list
```
## Main idea
Consider an equation of the form
$$
ax^2 + bx^2 + cxy = 1.
$$
Then it can be written as
$$
\begin{bmatrix} x & y \end{bmatrix}
\begin{bmatrix}
a & \frac{c}{2} \\
\frac{c}{2} & c
\end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}.
$$
Although an $1\times 1$ matrix is different from a scalar, we often abuse the notation and write
$$
\bx\trans A \bx = 1.
$$
Since $A$ is symmetirc, by the spectral theorem,
there is an orthonormal basis $\beta$ of $\mathbb{R}^n$ such that $[f_A]_\beta^\beta = D$ is a diagonal matrix.
By setting $Q$ as the matrix whose columns are vectors in $\beta$,
we get $Q$ is an orthogonal matrix such that $Q\trans AQ = D$ is a diagonal matrix.
We may let $Q\by = \bx$ and $\by = Q^{-1}\bx$.
This means $\by = [\bx]_\beta$ is the vector representation of $\bx$.
By viewing the equation $\bx\trans A\bx = 1$ from the perspective of $\beta$,
we get
$$
\bx\trans A\bx = \by\trans Q\trans A Q\by = \by\trans D\by = 1.
$$
It is much easier to describe the solution set of $\by\trans D\by = 1$ since $D$ is diagonal.
## Side stories
- conic section
## Experiments
##### Exercise 1
執行以下程式碼。
令 $\beta = \{\bv_1, \cdots, \bv_n\}$ 為 $Q$ 的各行向量。
```python
### code
set_random_seed(0)
print_ans = False
while True:
theta = choice([pi/6, pi/4, pi/3])
Q = matrix([
[cos(theta), -sin(theta)],
[sin(theta), cos(theta)]
])
l = [4*lam for lam in random_int_list(2, 3)]
D = diagonal_matrix(l)
A = Q * D * Q.transpose()
if A[0,1] != 0 and 0 not in l:
break
x,y = var("x y")
eqn = (A[0,0]*x^2 + 2*A[0,1]*x*y + A[1,1]*y^2 == 1)
pretty_print(eqn)
pretty_print(LatexExpr("Q ="), Q)
if print_ans:
pretty_print(LatexExpr("A ="), A)
pretty_print(LatexExpr("D ="), D)
if l[0] < 0 and l[1] < 0:
print("No solution.")
if l[0] * l[1] < 0:
print("Hyperbola counterclockwisely rotated in angle:")
pretty_print(theta)
implicit_plot(eqn, xrange=(-1,1), yrange=(-1,1)).show()
if l[0] > 0 and l[1] > 0:
print("Ellipse counterclockwisely rotated in angle:")
pretty_print(theta)
implicit_plot(eqn, xrange=(-1,1), yrange=(-1,1)).show()
```
$4\sqrt{3}xy+10x^2+6y^2=1$
$Q=\begin{bmatrix}
\frac{\sqrt{3}}{2} & -\frac{1}{2}\\
\frac{1}{2} & \frac{\sqrt{3}}{2}
\end{bmatrix}$
##### Exercise 1(a)
找一個 $2\times 2$ 矩陣 $A$,將上述方程式寫成
$$
\begin{bmatrix} x & y \end{bmatrix}
A
\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}.
$$
$Ans:$
$A=\begin{bmatrix}
10 & 2\sqrt{3} \\
2\sqrt{3} & 6
\end{bmatrix}$
##### Exercise 1(b)
計算 $D = Q^{-1}AQ$ 並說明同一個解集合用 $\beta$ 基底觀察出的方程式。
$Ans:$
$D=\begin{bmatrix}
12 & 0 \\
0 & 4
\end{bmatrix}$
$12x^2+4y^2=1$
##### Exercise 1(c)
描述這個方程式的解集合的形狀。
$Ans:$
橢圓
## Exercises
##### Exercise 2
描述以下方程式的解集合的形狀。
##### Exercise 2(a)
已知
$$
\begin{bmatrix}
4 & 0 \\
0 & 6
\end{bmatrix}
=
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}^{-1}
\begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}.
$$
考慮方程式 $5x^2 + 5y^2 - 2xy = 1$。
:::warning
- [x] $\ba = (\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})$ 及 $\bb = (\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}})$
- [x] 後面幾題也是
:::
Ans:
以 $\ba=(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})$ 及 $\bb=(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}})$ 兩向量為基底來看,
方程式 $5x^2 + 5y^2 - 2xy = 1$ 可視為 $4a^2+6b^2=1$ ,
因此方程式 $5x^2 + 5y^2 - 2xy = 1$ 的解集合的形狀為橢圓形。
##### Exercise 2(b)
已知
$$
\begin{bmatrix}
4 & 0 \\
0 & -6
\end{bmatrix}
=
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}^{-1}
\begin{bmatrix}
-1 & 5 \\
5 & -1
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}.
$$
考慮方程式 $-x^2 -y^2 + 10xy = 1$。
Ans:
以 $\ba=(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})$ 及 $\bb=(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}})$ 兩向量為基底來看,
方程式 $-x^2 -y^2 + 10xy = 1$ 可視為 $4a^2-6b^2=1$ ,
因此方程式 $-x^2 -y^2 + 10xy = 1$ 的解集合的形狀為雙曲線。
##### Exercise 2(c)
已知
$$
\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}
=
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}^{-1}
\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}.
$$
考慮方程式 $x^2 + y^2 + 2xy = 1$。
:::warning
- [x] 誰是誰的表示法怪怪的,應該是:
表示 $\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}$ 以 $\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}$ 做為基底下,觀察出的表示法為 $\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}$ 的矩陣。
後面有類似的狀況
:::
$Ans:$
方程式 $x^2 + y^2 + 2xy = 1$ 的形狀為,以 $a=(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})$ 及 $b=(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}})$ 兩向量為基底來看,形如 $2x^2=1$ 的兩條平行的斜直線。
因為
$$
\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}
$$
是對稱矩陣,可被 $\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}$ 這個垂直矩陣對角化,表示 $\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}$ 以 $\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}$ 做為基底表示的情況下,觀察出的表示法為 $\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}$ 的矩陣。
而$\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}$ 的二次型為 $\begin{bmatrix}
2x^2\end{bmatrix}= \begin{bmatrix}
1\end{bmatrix}$。
##### Exercise 3
描述以下方程式的解集合的形狀。
##### Exercise 3(a)
已知
$$
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 6
\end{bmatrix}
=
\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}^{-1}
\begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}.
$$
考慮方程式 $4x^2 + 4y^2 + 5z^2 - 2xz - 2yz = 1$。
$Ans:$
方程式 $4x^2 + 4y^2 + 5z^2 - 2xz - 2yz = 1$ 的形狀為,以 $a=(\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}}), b=(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}},0), c=( \frac{1}{\sqrt{6}}, \frac{1}{\sqrt{6}}, -\frac{2}{\sqrt{6}})$ 三向量為基底來看,形如 $3x^2+4y^2+6z^2=1$ 的一橢圓球形。
因為
$\begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}$ 是一對稱矩陣,可被$\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}$ 這個垂直矩陣對角化,表示說 $\begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}$ 是以 $\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}$ 為基底所表示的情況下,觀察出的表示法為 $\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 6
\end{bmatrix}$ 的矩陣。
而 $\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 6
\end{bmatrix}$ 的二次型為 $\begin{bmatrix}
3x^2+4y^2+6z^2\end{bmatrix}=\begin{bmatrix}
1\end{bmatrix}$。
##### Exercise 3(b)
已知
$$
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & -6
\end{bmatrix}
=
\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}^{-1}
\begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}.
$$
考慮方程式 $2x^2 + 2y^2 - 3z^2 - 4xy + 6xz + 6yz = 1$。
$Ans$
方程式 $2x^2 + 2y^2 - 3z^2 - 4xy + 6xz + 6yz = 1$ 是由
$3x^2 + 4y^2 +(-6)z^2 =1$ 樣子的一個單葉雙曲面,再把 $x,y,z$ 軸分別以$(\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}}),(\frac{1}{\sqrt{2}},\frac{-1}{\sqrt{2}},0),(\frac{1}{\sqrt{6}},\frac{1}{\sqrt{6}},\frac{-2}{\sqrt{6}})$ 這三個向量所形成的軸代替。
因為
$\begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}$ 為對稱矩陣,可由$\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}$ 這個旋轉矩陣對角化,這就代表
$\begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}$ 是以 $\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & -6
\end{bmatrix}$ 由 $\begin{bmatrix}
\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\
\frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}
\end{bmatrix}$ 為基底所形成的矩陣。

:::success
Good job.
:::
##### Exercise 3(c)
說明方程式 $2x^2 + 2y^2 - 3 - 4xy + 6x + 6y = 0$ 的解集合是一個三維圓椎和一個平面的交集。
:::info
對不起,題目出錯,應該是 $2x^2 + 2y^2 - 3 - 4xy + 6x + 6y = 1$。
請忽略這題。
:::
$Ans$
把此方程式除以 $3$ 可寫成 $\begin{bmatrix}
x &y &1\end{bmatrix}$
$\begin{bmatrix}
\frac{2}{3} & \frac{-2}{3} & 1 \\
\frac{-2}{3} & \frac{2}{3} & 1 \\
1 & 1 & 0
\end{bmatrix}$$\begin{bmatrix} x\\y\\1\end{bmatrix}$$=1$ 。
已知 $\begin{bmatrix}
\frac{2}{3} & \frac{-2}{3} & 1 \\
\frac{-2}{3} & \frac{2}{3} & 1 \\
1 & 1 & 0
\end{bmatrix}$ 為對稱矩陣,可知此方程式能以 $(x,y,1)$ 為軸所形成的圖形,而 $z$ 軸由常數 $1$ 取代所以相當於一個三維圓錐和一個平面的交集。
##### Exercise 4
令 $D$ 為一對角矩陣,
$n_+$、$n_-$、$n_0$ 分別為 $D$ 的對角線上正的、負的、為零的元素的個數。
考慮
$$
\begin{bmatrix} x & y \end{bmatrix}
D
\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}
$$
的解集合。
完成以下表格。
n+ | n- | n0 | shape
---|--- |--- | ---
2 |0 |0 | 橢圓
0 |2 |0 | 不存在
0 |0 |2 | 不存在
1 |1 |0 | 雙曲線
1 |0 |1 | 兩平行直線
0 |1 |1 | 不存在
:::info
目前分數 = 6 $\times$ 檢討 = 6.5
:::