平方完成

平方完成の過程を示したアニメーション。(Details, animated GIF version)

平方完成(へいほうかんせい、: completing the square)とは、二次式(二次関数)を式変形して a ( x h ) 2 {\displaystyle a(x-h)^{2}} の形を作り、一次の項を見かけ上なくすことである。この式変形は全ての二次式に可能で、一意に決まる。

a x 2 + b x + c = a ( x h ) 2 + k ( a 0 ) {\displaystyle ax^{2}+bx+c=a(x-h)^{2}+k\quad (a\neq 0)}

x h {\displaystyle x-h} h {\displaystyle h} を除けば、つまり x h = t {\displaystyle x-h=t} と変換すれば

a t 2 + k {\displaystyle at^{2}+k}

の形に帰着される。このことより、以下のことが導出できる:

また、平方完成の考え方を応用して解く手法も見られる(#類似の手法)。

概観

二次式 a x 2 + b x + c   ( a 0 ) {\displaystyle ax^{2}+bx+c\ (a\neq 0)} において、一次の項「 + b x {\displaystyle +\;\!\;\!bx} 」があるのとないのでは、応用上の取り扱いが大きく異なる。

変数 x {\displaystyle x} x h {\displaystyle x-h} の形になる代わりに一次の項がなくなれば、 h {\displaystyle h} の違いだけで済むことができる。

ここでは、二次の係数(最高次係数)1 の場合とそうでない場合に分けてみる。

二次の係数(最高次係数)が 1 の場合
x 2 + b x + c {\displaystyle x^{2}+bx+c}

の一次の項「 + b x {\displaystyle +\;\!\;\!bx} 」をなくして x 2 {\displaystyle x^{2}} ( x h ) 2 {\displaystyle (x-h)^{2}} の形にする。

( x h ) 2 = x 2 2 h x + h 2 {\displaystyle (x-h)^{2}=x^{2}-2hx+h^{2}}

より、一次の係数を比較すると

b = 2 h {\displaystyle b=-2h}
h = b 2 {\displaystyle h=-{\frac {b}{2}}}

これにより、x2 + bx + c の平方完成は次の式になる:

x 2 + b x + c = ( x + b 2 ) 2 b 2 4 + c {\displaystyle x^{2}+bx+c=\left(x+{\frac {b}{2}}\right)^{2}-{\frac {b^{2}}{4}}+c}
二次の係数(最高次係数)が 1 でない場合
a x 2 + b x + c ( a 0 ) {\displaystyle ax^{2}+bx+c\quad (a\neq 0)}

の一次の項「 + b x {\displaystyle +\;\!\;\!bx} 」をなくして x {\displaystyle x} x h {\displaystyle x-h} にする。

二次の係数が 1 の場合で得られた等式

x 2 + b x = ( x + b 2 ) 2 b 2 4 {\displaystyle x^{2}+bx=\left(x+{\frac {b}{2}}\right)^{2}-{\frac {b^{2}}{4}}}

を利用する。

a x 2 + b x + c = a ( x 2 + b a x ) + c = a { ( x + b 2 a ) 2 ( b 2 a ) 2 } + c = a ( x + b 2 a ) 2 b 2 4 a + c = a ( x + b 2 a ) 2 b 2 4 a c 4 a {\displaystyle {\begin{aligned}ax^{2}+bx+c&=a\left(x^{2}+{\frac {b}{a}}x\right)+c\\&=a\left\{\left(x+{\frac {b}{2a}}\right)^{2}-\left({\frac {b}{2a}}\right)^{2}\right\}+c\\&=a\left(x+{\frac {b}{2a}}\right)^{2}-{\frac {b^{2}}{4a}}+c\\&=a\left(x+{\frac {b}{2a}}\right)^{2}-{\frac {b^{2}-4ac}{4a}}\end{aligned}}} [1]

つまり、一次以上の項を二次の係数 a で括ることにより、二次の係数が 1 の場合を利用している。

二次形式の平方完成

1変数の二次式の平方完成を踏まえて、一般の n 変数二次式に対しても、平方完成ができる。例えば二変数なら

a x 2 + b x y + c y 2 + d x + e y + f ( a b c 0 ) {\displaystyle ax^{2}+bxy+cy^{2}+dx+ey+f\quad (abc\neq 0)}

である。これは二次形式

( x y ) ( a b 2 b 2 c ) ( x y ) + ( x y ) ( d e ) + f ( a b c 0 ) {\displaystyle {\begin{pmatrix}x&y\end{pmatrix}}{\begin{pmatrix}a&{\frac {b}{2}}\\{\frac {b}{2}}&c\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}+{\begin{pmatrix}x&y\end{pmatrix}}{\begin{pmatrix}d\\e\end{pmatrix}}+f\quad (abc\neq 0)}

の形で書ける。

一般の n 変数二次式は、A対称行列として

t x A x + t x b + c = t ( x h ) A ( x h ) + k ( h = 1 2 A 1 b , k = c 1 4 t b A 1 b ) {\displaystyle {}^{t}xAx+{}^{t}xb+c={}^{t}(x-h)A(x-h)+k\quad \left(h=-{\frac {1}{2}}A^{-1}b,\quad k=c-{\frac {1}{4}}{}^{t}bA^{-1}b\right)}

で書ける。

A が対称でないときは hk の式が

h = ( A + t A ) 1 b , k = c t h A h = c t b ( A + t A ) 1 A ( A + t A ) 1 b {\displaystyle h=-(A+{}^{t}A)^{-1}b,\quad k=c-{}^{t}hAh=c-{}^{t}b\,(A+{}^{t}A)^{-1}A\,(A+{}^{t}A)^{-1}b}

とやや一般になるが同じ式で書ける。

幾何学的解釈

二次方程式

x 2 + b x = a {\displaystyle x^{2}+bx=a}

を平方完成により解くことを考える。この過程を、面積図で表すと次のようになる。

x2 は一辺が x の正方形の面積、bx は縦横が b, x の長方形の面積に等しい。面積 bx の長方形を2等分割して、長さ x の辺で正方形と貼り合わせる。すると、正方形の角が欠けた形になる。

欠けている角に一辺が b/2 の正方形を補うと、全体が正方形になる。したがって、両辺に (b/2)2 を加えると、平方 (x + b/2)2 が完成する。

類似の手法

平方完成とは、u2 + 2uv の形の式に第三項 v2 を加えて完全平方式を作る操作である。u2 + v2 が先に与えられていても、中間項 2uv または −2uv を加えることにより完全平方式を得ることができる。

相反式の平方完成

正の実数 x に対して、自身とその逆数の和は

x + 1 x = ( x 2 + 1 x ) + 2 = ( x 1 x ) 2 + 2 {\displaystyle {\begin{aligned}x+{\frac {1}{x}}&=\left(x-2+{\frac {1}{x}}\right)+2\\[5pt]&=\left({\sqrt {x}}-{\frac {1}{\sqrt {x}}}\right)^{2}+2\end{aligned}}}

このように平方完成すると、正の数とその逆数の和は常に 2 以上であることが示される。

複二次式の因数分解

複二次式

x 4 + 324 {\displaystyle x^{4}+324}

因数分解することを考える。この式は ( x 2 ) 2 + 18 2 {\displaystyle (x^{2})^{2}+18^{2}} と見ることができるから、中間項 2(x2)(18) = 36x2 を考え、

x 4 + 324 = ( x 4 + 36 x 2 + 324 ) 36 x 2 = ( x 2 + 18 ) 2 ( 6 x ) 2 = ( x 2 + 18 + 6 x ) ( x 2 + 18 6 x ) = ( x 2 + 6 x + 18 ) ( x 2 6 x + 18 ) {\displaystyle {\begin{aligned}x^{4}+324&=(x^{4}+36x^{2}+324)-36x^{2}\\&=(x^{2}+18)^{2}-(6x)^{2}\\&=(x^{2}+18+6x)(x^{2}+18-6x)\\&=(x^{2}+6x+18)(x^{2}-6x+18)\end{aligned}}}

と因数分解できる。

二次方程式の解

二次関数のグラフ

Graphs of quadratic functions shifted to the right by h = 0, 5, 10, and 15.
二次関数のグラフが x軸方向に h = 0, 5, 10, 15 平行移動する様子。
Graphs of quadratic functions shifted upward by k = 0, 5, 10, and 15.
二次関数のグラフが y軸方向に k = 0, 5, 10, 15 平行移動する様子。
Graphs of quadratic functions shifted upward and to the right by 0, 5, 10, and 15.
二次関数のグラフが x軸方向、y軸方向共に 0, 5, 10, 15 ずつ平行移動する様子。

二次関数 y = a x 2 + b x + c ( a 0 ) {\displaystyle y=ax^{2}+bx+c\quad (a\neq 0)} xy-座標平面におけるグラフは、平方完成することによりその様子がよく分かる。

関数式 a x 2 + b x + c {\displaystyle ax^{2}+bx+c} を平方完成して

y = a ( x h ) 2 + k {\displaystyle y=a(x-h)^{2}+k}

これのグラフは、放物線 y = a x 2 {\displaystyle y=ax^{2}} x軸方向に h {\displaystyle h} y軸方向に k {\displaystyle k} 平行移動したものであると分かる。特に、頂点(停留点)があり、その座標

( h , k ) {\displaystyle (h,k)}

であることが分かる。軸の方程式は

x = h {\displaystyle x=h}

である。

a > 0 の場合、x = h最小値 k をとる。
a < 0 の場合、x = h最大値 k をとる。

応用

積分

不定積分

d x a x 2 + b x + c {\displaystyle \int {\frac {dx}{ax^{2}+bx+c}}}

の被積分関数に平方完成を適用すれば、より基本的な積分

d x x 2 a 2 = 1 2 a ln | x a x + a | + C {\displaystyle \int {\frac {dx}{x^{2}-a^{2}}}={\frac {1}{2a}}\ln \left|{\frac {x-a}{x+a}}\right|+C}

または

d x x 2 + a 2 = 1 a arctan x a + C {\displaystyle \int {\frac {dx}{x^{2}+a^{2}}}={\frac {1}{a}}\arctan {\frac {x}{a}}+C}

に帰着できる( C {\displaystyle C} 積分定数)。

複素数

z複素数とするとき、

| z | 2 b z b z + c {\displaystyle |z|^{2}-b^{*}z-bz^{*}+c}
b は複素数、c実数
z*, b* はそれぞれ z, b複素共役

は常に実数である。このことは、複素数に対する恒等式 |u|2 = uu* を用いて、式を以下のように変形すると分かる:

| z | 2 b z b z + c = z z b z b z + b b b b + c = z ( z b ) b ( z b ) | b | 2 + c = ( z b ) ( z b ) | b | 2 + c = ( z b ) ( z b ) | b | 2 + c = | z b | 2 | b | 2 + c {\displaystyle {\begin{aligned}|z|^{2}-b^{*}z-bz^{*}+c&=zz^{*}-b^{*}z-bz^{*}+bb^{*}-bb^{*}+c\\&=z(z^{*}-b^{*})-b(z^{*}-b^{*})-|b|^{2}+c\\&=(z-b)(z^{*}-b^{*})-|b|^{2}+c\\&=(z-b)(z-b)^{*}-|b|^{2}+c\\&=|z-b|^{2}-|b|^{2}+c\end{aligned}}}

別の例として、a, b, x, y を実数とするとき、

a x 2 + b y 2 {\displaystyle ax^{2}+by^{2}}

は、a > 0, b > 0 のとき、複素数の絶対値の平方を用いて書くことができる。実際に、 z = a x + i b y {\displaystyle z={\sqrt {a}}\,x+i{\sqrt {b}}\,y} と置けば

| z | 2 = z z = ( a x + i b y ) ( a x i b y ) = a x 2 + b y 2 {\displaystyle {\begin{aligned}|z|^{2}&=zz^{*}\\&=({\sqrt {a}}\,x+i{\sqrt {b}}\,y)({\sqrt {a}}\,x-i{\sqrt {b}}\,y)\\&=ax^{2}+by^{2}\end{aligned}}}

となる。

冪等行列

正方行列 M冪等とは M2 = M が成り立つことである。

M = ( a b b 1 a ) {\displaystyle M={\begin{pmatrix}a&b\\b&1-a\end{pmatrix}}}

は、 a 2 + b 2 = a {\displaystyle a^{2}+b^{2}=a} ならば冪等行列である。平方完成により

( a 1 2 ) 2 + b 2 = 1 4 {\displaystyle (a-{\tfrac {1}{2}})^{2}+b^{2}={\tfrac {1}{4}}}

M が実行列なら、これは ab-平面において中心 (1/2, 0)、半径 1/2 の円の方程式である。角度 θ を用いて書けば、

M = 1 2 ( 1 cos θ sin θ sin θ 1 + cos θ ) {\displaystyle M={\frac {1}{2}}{\begin{pmatrix}1-\cos \theta &\sin \theta \\\sin \theta &1+\cos \theta \end{pmatrix}}}

と媒介変数表示できる。

参考文献

  1. ^ Narasimhan, Revathi (2008). Precalculus: Building Concepts and Connections. Cengage Learning. pp. 133–134. ISBN 0-618-41301-4. https://books.google.com/books?id=hLZz3xcP0SAC , Section Formula for the Vertex of a Quadratic Function, page 133–134, figure 2.4.8
  • Algebra 1, Glencoe, ISBN 0-07-825083-8, pp.539-544
  • Algebra 2, Saxon, ISBN 0-939798-62-X, pp.214-214, 241-242, 256-257, 398-401

外部リンク

ウィキメディア・コモンズには、平方完成に関連するカテゴリがあります。
  • Weisstein, Eric W. "Completing the Square". mathworld.wolfram.com (英語).
  • completing the square in nLab(英語)
  • Completing the square - PlanetMath.org(英語)
  • Completing the Square at ProofWiki(英語)
  • How to Complete the Square, Education Portal Academy(英語)
  • 『{{{2}}}』 - 高校数学の美しい物語