[Common Math 1 Part 3] Bivariate Polynomials and Matrices

한국어 버전

1. From One Variable to Two

1.1 Why Do We Need Two Variables?

Many real-world phenomena depend on multiple variables. Whenever a single variable fails to capture the relationship, a bivariate polynomial becomes our tool.

Field Variables Example polynomial
Physics Position (x,y)(x, y) E(x,y)=ax2+by2+cxyE(x, y) = ax^2 + by^2 + cxy (electric field)
Economics Price and demand C(p,q)=ap2+bq2+cpq+dp+eq+fC(p, q) = ap^2 + bq^2 + cpq + dp + eq + f (cost function)
Image processing Pixel coordinates (x,y)(x, y) Brightness stored in a 2‑D array
Meteorology Latitude and longitude T(lat,lon)T(lat, lon) for temperature

Bivariate polynomials formalize these multidimensional relationships.

1.2 Anatomy of a Bivariate Polynomial

Consider P(x,y)=3x2y+2xy2+5x+7y+1.P(x, y) = 3x^2y + 2xy^2 + 5x + 7y + 1.

Term Degree in xx Degree in yy Coefficient
3x2y3x^2y 2 1 3
2xy22xy^2 1 2 2
5x5x 1 0 5
7y7y 0 1 7
11 0 0 1

This table gives us the information we need to place each term in a grid.

Degree terminology:

  • The degree in xx is the largest exponent of xx that appears, so here it is 2.
  • The degree in yy is the largest exponent of yy that appears, so here it is 2.
  • The total degree of one term is the sum of its exponents. For example, x2yx^2y has total degree 2+1=32 + 1 = 3.
  • The total degree of the polynomial is the largest total degree among its terms, so here it is 3.

We will use the degree of yy for rows and the degree of xx for columns. That choice is a convention, not a law, but once we choose it we must use it consistently.

2. Array Representation

2.1 Thinking in 2‑D Arrays

Use the degree of yy for rows and the degree of xx for columns. To make that visible, start with a labeled coefficient table.

x2x^2 x1x^1 x0x^0
y2y^2 0 2 0
y1y^1 3 0 7
y0y^0 0 5 1

Each position stores the coefficient of exactly one term:

  • row y2y^2, column x1x^1 gives 2, so that entry represents 2xy22xy^2
  • row y1y^1, column x2x^2 gives 3, so that entry represents 3x2y3x^2y
  • row y0y^0, column x1x^1 gives 5, so that entry represents 5x5x
  • row y0y^0, column x0x^0 gives 1, so that entry represents the constant term

The same information can be written as a matrix:

P=[020307051]P = \begin{bmatrix} 0 & 2 & 0 \\ 3 & 0 & 7 \\ 0 & 5 & 1 \end{bmatrix}

Because the degrees are listed in descending order, the top row is the y2y^2 row and the leftmost column is the x2x^2 column.

Reading the matrix:

  • top middle entry 2 means the coefficient of x1y2x^1y^2
  • middle left entry 3 means the coefficient of x2y1x^2y^1
  • bottom middle entry 5 means the coefficient of x1y0x^1y^0
  • bottom right entry 1 means the coefficient of x0y0x^0y^0

This row-column layout is a convention. We could swap the roles of xx and yy, but then every example and operation would need to follow that new convention consistently.

Visualization:

2변수 다항식 -> 계수 행렬

최고차항을 확인하고, 내림차순 행렬 틀을 만든 뒤 계수를 채웁니다

형식: ax^2y+bxy^2+cx+dy+e (예: 3x^2y+2xy^2+5x+7y+1)

입력 식 미리보기

3x^{2}y+2xy^{2}+5x+7y+1

핵심은 x, y의 최고차항으로 행렬 크기를 정한 뒤 각 항의 계수를 해당 칸에 넣는 것입니다.

변환 과정

진행률 0%
Step 1
행렬 크기
Step 2
계수 배치

변환을 시작할 준비가 되었습니다

최고차항으로 행렬 크기를 정한 뒤, 다음 화면에서 레이저 가이드로 계수를 채웁니다.

2.2 Seeing Polynomials as Matrices

Why matrices?

  1. Structural match: rows/columns correspond directly to the two degrees.
  2. Addition match: matrix addition exactly matches polynomial addition coefficient by coefficient.
  3. Clear bookkeeping: even when some terms are missing, their positions still stay fixed in the grid.
Python (NumPy)

P = np.array([
    [0, 2, 0],
    [3, 0, 7],
    [0, 5, 1]
])

print(P.shape)
print(P[1, 0])  # coefficient of x²y
print(P[0, 1])  # coefficient of xy²

3. Operating on Bivariate Polynomials

3.1 Why Addition Works

Suppose two polynomials both contain an xaybx^ay^b term. When we add the polynomials, we add the coefficients of those matching terms.

That is exactly what the matrix does. The entry in one fixed position always represents one fixed degree pair, so adding two matrices entry by entry is the same as adding two polynomials term by term.

For example, in the matrix below the middle entry of the bottom row represents the coefficient of xx:

[020307051]\begin{bmatrix} 0 & 2 & 0 \\ 3 & 0 & 7 \\ 0 & 5 & 1 \end{bmatrix}

If another polynomial has 4 in that same position, then the new coefficient of xx becomes 5+4=95 + 4 = 9.

3.2 Matrix Addition

Let

P(x,y)=2x2+xy+3y+1P(x, y) = 2x^2 + xy + 3y + 1

Q(x,y)=x2xy+2y2+4Q(x, y) = x^2 - xy + 2y^2 + 4

Their matrices are

P=[000013201],Q=[002010104].P = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 3 \\ 2 & 0 & 1 \end{bmatrix},\quad Q = \begin{bmatrix} 0 & 0 & 2 \\ 0 & -1 & 0 \\ 1 & 0 & 4 \end{bmatrix}.

Element-wise addition gives

P+Q=[002003305]P + Q = \begin{bmatrix} 0 & 0 & 2 \\ 0 & 0 & 3 \\ 3 & 0 & 5 \end{bmatrix}

which means 3x2+2y2+3y+53x^2 + 2y^2 + 3y + 5.

Notice what happened to the xyxy term: the coefficient 1 in PP and the coefficient -1 in QQ are in the same position, so they add to 0 and disappear.

Python (NumPy)

P = np.array([
    [0, 0, 0],
    [0, 1, 3],
    [2, 0, 1]
])

Q = np.array([
    [0, 0, 2],
    [0, -1, 0],
    [1, 0, 4]
])

print(P + Q)

3.3 Real Applications

Image processing

  • RGB images store brightness as 2‑D arrays.
  • Filters use nearby entries in the array to blur or sharpen an image.
Python snippet
# Simplified brightness adjustment
image = np.array([...])
brightness_adjusted = image + 20

Physics simulations

  • Model heat or pressure at each grid point (x,y)(x, y).

Economics

  • Model cost as a function of two resources and study how the cost changes.

3.4 Practice Problems

2변수 다항식 퀴즈

1 / 0
1 / 0
진행률 0%

문제와 목표 행렬

문제

입력 목표

행은 y^{0}에서 y^0까지, 열은 x^{0}에서 x^0까지 입력합니다.

예시 형식: [[0]]

정답 입력 (행렬 형식)

형식: [[행1], [행2], ...]

Extra drills

Problem 1 Express P(x,y)=2x2+3xyy2+5x2y+4P(x, y) = 2x^2 + 3xy - y^2 + 5x - 2y + 4 as a matrix.

Answer
x2x^2 x1x^1 x0x^0
y2y^2 0 0 -1
y1y^1 0 3 -2
y0y^0 2 5 4
P=[001032254]P = \begin{bmatrix} 0 & 0 & -1 \\ 0 & 3 & -2 \\ 2 & 5 & 4 \end{bmatrix}

Problem 2 Let Q(x,y)=x2xy+2y23x+y1Q(x, y) = x^2 - xy + 2y^2 - 3x + y - 1. Find P+QP + Q via matrix addition.

Answer
P+Q=[001021323]P + Q = \begin{bmatrix} 0 & 0 & 1 \\ 0 & 2 & -1 \\ 3 & 2 & 3 \end{bmatrix}

So 3x2+2xy+y2+2xy+33x^2 + 2xy + y^2 + 2x - y + 3.

🎯 Hands-on practice

2변수 다항식 덧셈/뺄셈 연습

행렬 변환부터 연산 과정 확인까지 3단계

2변수 다항식 덧셈/뺄셈 연습

Phase 1/3
모드:
1. 행렬 변환 2. 행렬 연산 3. 과정 확인
먼저 P와 Q를 같은 차수 체계의 행렬로 바꿉니다.

원본 식과 결과 흐름

입력식 P(x,y)
0
+
입력식 Q(x,y)
0
결과 다항식
행렬 연산 후 결과가 여기에 정리됩니다

주어진 2변수 다항식을 행렬로 변환하세요 (최대 3차)

P(x,y) = 0
Q(x,y) = 0
Q1. P(x,y)를 행렬로 표현하시오:
Q2. Q(x,y)를 행렬로 표현하시오:

4. Wrap-Up

Extending to two variables multiplies our expressive power. We can move from straight-line worlds to curved surfaces and coupled relationships.

Key takeaways:

  • Bivariate polynomials model multidimensional relationships.
  • Matrices give a systematic way to manage the coefficients.
  • Matrix addition matches polynomial addition because each position represents one degree pair.

This foundation leads directly to linear algebra, computer graphics, machine learning, and more.


Next preview: extending to three, four, or even nn variables introduces higher-dimensional arrays—tensors—which power modern AI and deep learning. Stay tuned!

💬 댓글

이 글에 대한 의견을 남겨주세요