TCM Algebra 4: Quadratic and Cubic Equations

**By: Tao Steven Zheng 鄭濤**

## **Opening the Square**

Chinese arithmeticians of the Han dynasty (206 BC - 220 AD) were proficient at extracting square roots and extended their methods to solving quadratic equations. The ancient Chinese called their algorithm of extracting square roots the *kai fang shu* (開方術, "method of opening the square"). This ingenious algorithm, though straightforward, was likely difficult to master because the arithmetician needed to perform a series of estimation, division, and subtraction in successive iterations to uncover the result. Despite the mechanical steps of the *kai fang shu* being purely arithmetic in nature, its rationale was based on a geometric argument. Figure 1 illustrates a three iteration example, starting with the yellow square, and followed by adding successive squares and rectangles to fill up the entire square. This geometric argument can be better understood algebraically as

(
a
b
c

)
2

=

a
2

(

b
2

2
a
b
)
(

c
2

2
a
c
2
b
c
)

{\displaystyle (a+b+c)^2 = a^2 + (b^2 + 2ab) + (c^2 + 2ac + 2bc)}

Of course, the *kai fang shu* is not limited to three iterations and could in theory continue indefinitely; nevertheless, the problems found in the *Jiuzhang Suanshu* generally terminate within three or four iterations. A basic outline of the square root algorithm is given in Chapter 4 of the *Jiuzhang Suanshu*:

In the above passage, one finds several terminologies unique to the calculation process. Since the square root algorithm was classified as a form of division, many terms were borrowed from the division algorithm. For example, the *shi* (實) is taken to mean the radicand when computing square roots. One can easily see why this is so, for the radicand is analogous to the dividend. On the other hand, the *fa* (法) still means the divisor due to the fact that division is still an integral operation when performing the square root algorithm.

The *jie yi suan* (借一算), also called the *jie suan* (借算, "borrowed rod") is a counting rod that is used to mark the positions of the radicand. For the *kai fang shu*, the *jie suan* is moved two positions to the left in order to determine the largest place-value of the root. From an algebraic point of view, the *jie suan* is a rod that represents the coefficient of the quadratic term.

### **Problem Study 1: Opening the Square**

In this problem study, we will examine the Chinese square root algorithm (開方術 *kai fang shu*) in detail by explaining the layout and steps. Each calculation step will be elaborated with an algebraic interpretation.

答曰：二百三十五步。
Answer: 235 *bu*.

**Solution for *Jiuzhang Suanshu* [4.12]**

The following solution gives a clear illustration of the *kai fang shu*. In ancient China, all zeroes were simply left empty.

(1) Set the radicand (实 *shi*) and the marker rod (借算 *jie suan*) on the counting board.

(2) Shift the marker rod (借算 *jie suan*) to match the leftmost place-value of the radicand (實 *shi*) and estimate the magnitude of the root by skipping one place-value for each step. Here the marker rod (借算 *jie suan*) lands on the ten-thousands place; therefore, the square root should be in the hundreds.

(3) Make the first estimate. Since

200
2

<
55225
<

300
2

{\displaystyle 200^2 < 55225 < 300^2 }

, the first estimate should be 200. Place a 2 in the hundreds place of the result (議所得 *yi suo de*).

(4) Double the marker rod (借算 *jie suan*) and let that be the divisor (法 *fa*).

(5) Subtract twice the divisor (法 *fa*) from the radicand (實 *shi*).

55225
−
2
×
# 20000
15225

{\displaystyle 55225 - 2 \times 20000 = 15225}

(6) Multiply divisor (法 *fa*) by the 2 in the hundreds place of the result (議所得 *yi suo de*), then divide by 10. Make this the new divisor (法 *fa*).

2
×
20000

10

=
4000

{\displaystyle \frac{2\times20000}{10} = 4000}

Shift the marker rod (借算 *jie suan*) two places to the right.

(7) Make an estimate for the tens place. Since

4000
×
30
<
15225
<
4000
×
40

{\displaystyle 4000 \times 30 < 15225 < 4000 \times 40}

, the estimate should be 30. Add a 3 to the tens place of the result (議所得 *yi suo de*).

(8) Multiply the marker rod (借算 *jie suan*) by the 3 in the tens place of the estimate (議得 *yi de*).

3
×
# 100
300

{\displaystyle 3 \times 100 = 300}

Add this to the divisor (法 *fa*).

(9) Multiply the divisor (法 *fa*) by the 3 in the tens place of the result (議所得 *yi suo de*) and subtract this from the remaining radicand (實 *shi*).

15225
−
3
×
# 4300
2325

{\displaystyle 15225 - 3 \times 4300 =2325}

(10) Multiply the marker rod (借算 *jie suan*) by the 3 in the tens place of the result (議所得 *yi suo de*). Add this to the divisor (法 *fa*), then divide by 10. Make this the new divisor (法 *fa*).

3
×
100
4300

10

=
460

{\displaystyle \frac{3 \times 100 + 4300}{10} = 460}

Shift the marker rod (借算 *jie suan*) two places to the right.

(11) Make an estimate for the ones place. Since

460
×
5
<
2325
<
460
×
6

{\displaystyle 460 \times 5 < 2325 < 460 \times 6}

, the estimate should be 5. Add this to the ones place of the result (議所得 *yi suo de*).

(12) Multiply the marker rod (借算 *jie suan*) by the 5 in the ones place of the result (議得 *yi de*). Add this to the divisor (法 *fa*).

(13) Multiply the divisor (法 *fa*) by the 5 in the tens place of the result (議所得 *yi suo de*) and subtract this from the remaining radicand (實 *shi*).

2325
−
5
×
# 465
0

{\displaystyle 2325 - 5 \times 465 = 0 }

## **Quadratic Equations**

The ingenious method of the *kai fang shu* (square root algorithm) was later extended to solve quadratic equations of the form

x
2

b
# x
c

{\displaystyle x^2 + bx = c}

, where

x

{\displaystyle x}

 is the unknown quantity and

b
,
c

{\displaystyle b, c}

 are constants. The coefficient of the linear term is called the *cong fa* (從法), and the *Jiuzhang Suanshu* does not explicitly explain how the *cong fa* is incorporated in the square root algorithm. One plausible solution method would be to first implement the well-known technique called "completing the square". By completing the square, one can transform the above quadratic equation into a simpler square root problem. For example, the equation

x
2

b
# x
c

{\displaystyle x^2 + bx = c}

 becomes

y
2

=
d

{\displaystyle y^2 = d}

 after a change of variable

# x
y
−

b
2

{\displaystyle x = y - \frac{b}{2} }

and transformed constant

# d
c

(

b
2

)

2

{\displaystyle d = c + {\left(\frac{b}{2}\right)}^{2} }

.

### **Problem Study 2: Square Town**

答曰：二百五十步。

術曰：以出北門步數乘西行步數，倍之，為實。并出南門步數為從法，開方除之，即邑方。

Answer: 250 *bu*.

Method: Multiply the number of *bu* walked from the north gate by the number of *bu* walked west, then double this result. Let this be the radicand (實 *shi*). Add the number of *bu* walking from the south and north gates, and let this be the (從法 *cong* *fa*). Extract the square root to obtain the side of the city.

**Solution for *Jiuzhang Suanshu* [4.12]**

   Let

x

{\displaystyle x}

 be the width of the town. By proportion,

20

x

/

2

=

x
14
20

1775

.

{\displaystyle
\frac{20}{x/2} = \frac{x+14+20}{1775}.
}

Cross-multiplication and a bit of rearrangement yields the quadratic equation

x

2

34
x
−
# 71000
0

{\displaystyle
{x}^{2} + 34x - 71000 = 0
}

After making the transformation

# x
y
−
17

{\displaystyle x = y - 17 }

, the above quadratic equation becomes

y

2

=
71289

{\displaystyle
{y}^{2} = 71289
}

Extracting the positive square root gives

# y
267

{\displaystyle
y= 267
}

, which means the final answer is

# x
250

{\displaystyle
x=250
}

. Therefore, the width of the square town is 250 *bu*.

## **Opening the Cube**

The study of cubic equations in ancient China began with the extraction of cube roots. The earliest extant cube root problems are found in Chapter 4 of the *Jiuzhang Suanshu*. Each problem involves a given volume in the shape of a cube and the question asks for the side length of the cube. Ancient Chinese mathematicians devised an ingenious algorithm for computing cube roots. the method is aptly called the *kai li fang shu* (開立方術, "method of opening the cube").

[1] 实：开方术的“实”是指被开立方根之数。

*Shi* means the radicand when computing cube roots.

[2] 借一算：又称“借算”，意思是借一枚算筹来表示未知数二次项的系数1。

Also called *jie suan*. From an algebraic point of view, the *jie suan* is a rod that represents the coefficient of the quadratic term.

[3] 超一等：隔一位。

Skipping every other place value (i.e. skip tens, thousands, etc)

[4] 议所得：商议根的第一位得数。

A first estimate of the cube root.

[5] 面：正方形面积的边长。

The side length of the cube.

[6] 通分内子：设整数部分为 ，分子为 ， 分母为 。

Let the whole part be , the numerator be , and the denominator be .

[7] 母不可开者：如果分母不是完全平方数，按照以下的计算方法进行。

If the denominator is not a perfect square, then proceed with the calculation method below.

### **Problem Study 3: Opening the Square**

答曰：一百二十三尺。

Answer: 123 *chi*.

**Solution for *Jiuzhang Suanshu* [4.19]**

The following solution gives a clear illustration of the *kai li fang shu* and its equivalent algebraic representation.

**(1)** Set up the initial problem

x
3

=
1860867

{\displaystyle x^3 = 1860867}

 on the counting board. The radicand (实 *shi*) is 1860867. The marker rod (借算 *jie suan*) is placed in the ones digit.

**(2)** Use the marker rod to make an estimate of the largest digit for the result. The largest digit for this problem is in the hundreds. For the algebraic interpretation, let

# x
100

x
1

{\displaystyle x = 100x\_1}

.

(
100

x
1

)
3

=
1860867

1000000

x
1
3

=
1860867

{\displaystyle \begin{align}
(100x\_1)^3 = 1860867\\[5 pt]
1000000x\_1^3 = 1860867

\end{align}}

**(3)**

**(4)**

**(5)**

**(6)**

**(7)**

**(8)**

**(9)**

**(10)**

**(11)**

**(12)**

**(13)**

**(14)**

**(15)**

**(16)**

**(17)**

**(18)**

**(19)**