# 配方法

$ax^2 + bx + c = a(\cdots\cdots)^2 + \mbox{k}$ ，其中 k 是某常數

## 簡介

$a x^2 + b x\,\!$

$(c x + d)^2 + e\,\!$

\begin{align} ax^2+bx+c &{}= 0\\ ax^2+bx &{}= -c\\ x^2 + \left( \frac{b}{a} \right) x &{}= -\frac{c}{a}\\ \end{align}

\begin{align} x^2 + \frac{b}{a} x + \left(\frac{b}{2a}\right)^2 &{}= \left(\frac{b}{2a}\right)^2 -\frac{c}{a} \\ \left(x + \frac{b}{2a}\right)^2 &{}= \frac{b^2-4ac}{4a^2}\\ x + \frac{b}{2a} &{}= \pm\frac{\sqrt{b^2-4ac}}{2a}\\ x &{}= \frac{-b \pm \sqrt{b^2-4ac}}{2a} \end{align}

## 幾何學的觀點

$x^2 + bx = a.\,$

## 一般公式

### 描述

$a x^2 + b x = (c x + d)^2 + e , \,\!$

\begin{align} c &{}= \sqrt{a} ,\\ d &{}= \frac{b}{2\sqrt{a}} ,\\ e &{}= -d^2\\ &{}= -\left(\frac{b}{2\sqrt{a}}\right)^2\\ &{}= -\frac{b^2}{4a} . \end{align}

$a x^2 + b x = \left(\sqrt{a}\,x + \frac{b}{2 \sqrt{a}}\right)^2 - \frac{b^2}{4a} . \,\!$

### 證明

$\left(cx + d\right)^2 + e = c^2 x^2 + 2cdx + d^2 + e .$

$c^2 x^2 + 2cdx + d^2 + e\!$

\begin{align} a &{}= c^2 ,\\ b &{}= 2cd ,\\ f &{}= d^2 + e . \end{align}

\begin{align} c &{}= \pm \sqrt{a} ,\\ d &{}= \frac{b}{2c}\\ &{}= \pm \frac{b}{2\sqrt{a}} ,\\ e &{}= f - d^2\\ &{}= f - \frac{b^2}{4a} \end{align}

## 例子

### 具體例子

\begin{align}5x^2 + 7x - 6 &{}= 5\left(x^2 + {7 \over 5}x\right) -6 \\ &{}= 5\left[x^2 + {7 \over 5}x +\left({7 \over 10}\right)^2\right] - 6 - 5\left({7 \over 10}\right)^2 \\ &{}= 5\left(x + {7 \over 10}\right)^2 - 6 - {7^2 \over 2\cdot 10} \\ &{}= 5\left(x + {7 \over 10}\right)^2 - {6\cdot 20 + 7^2 \over 20} \\ &{}= 5\left(x + {7 \over 10}\right)^2 - {169 \over 20} \end{align}

\begin{align} 5x^2 + 7x - 6 &{}= 0\\ 5\left(x + {7 \over 10}\right)^2 - {169 \over 20} &{}= 0\\ \left(x + {7 \over 10}\right)^2 &{}= {169 \over 100}\\ &{}= \left({13 \over 10}\right)^2\\ x + {7 \over 10} &{}= \pm {13 \over 10}\\ x &{}= {-7 \pm 13 \over 10}\\ &{}= {3 \over 5}\mbox{ or }-2 \end{align}

$y = 5x^2 + 7x - 6 , \,\!$

$y = 5\left(x + \frac{7}{10}\right)^2 - \frac{169}{20} ,$

$x = -{7 \over 10} ,$

### 微積分例子

$\int\frac{1}{9x^2-90x+241}\,dx.\,\!$

$9x^2-90x+241=9(x^2-10x)+241.\,\!$

\begin{align} 9(x^2-10x)+241 &{}=9(x^2-10x+25)+241-9(25)\\ &{}=9(x-5)^2+16 . \end{align}

\begin{align} \int\frac{1}{9x^2-90x+241}\,dx &{}=\frac{1}{9}\int\frac{1}{(x-5)^2+(\frac{4}{3})^2}\,dx\\ &{}=\frac{1}{9}\cdot\frac{3}{4}\arctan\frac{3(x-5)}{4}+C \end{align}

### 複數例子

$|z|^2 - b^*z - bz^* + c,\,$

$|z-b|^2 - |b|^2 + c , \,\!$

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

$ax^2 + by^2 + c , \,\!$

$z = \sqrt{a}\,x + i \sqrt{b} \,y .$

\begin{align} |z|^2 &{}= z z^*\\ &{}= (\sqrt{a}\,x + i \sqrt{b}\,y)(\sqrt{a}\,x - i \sqrt{b}\,y) \\ &{}= ax^2 - i\sqrt{ab}\,xy + i\sqrt{ba}\,yx - i^2by^2 \\ &{}= ax^2 + by^2 , \end{align}

$ax^2 + by^2 + c = |z|^2 + c \,\!$

## 方法的變化

$u^2 + 2uv\,$

$u^2 + v^2\,$

### 例子：正數與它的倒數的和

\begin{align} x + {1 \over x} &{} = \left(x - 2 + {1 \over x}\right) + 2\\ &{}= \left(\sqrt{x} - {1 \over \sqrt{x}}\right)^2 + 2 \end{align}

### 例子：分解四次多項式

$x^4 + 324 . \,\!$

$(x^2)^2 + (18)^2, \,\!$

\begin{align} 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{align}