# 配方法

（重定向自配方

${\displaystyle ax^{2}+bx+c=a(x-h)^{2}+k}$，其中${\displaystyle h}$${\displaystyle k}$常數

## 簡介

${\displaystyle ax^{2}+bx\,\!}$

${\displaystyle (cx+d)^{2}+e\,\!}$

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

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

## 几何学的观点

${\displaystyle x^{2}+bx=a.\,}$

## 一般公式

### 描述

${\displaystyle ax^{2}+bx=(cx+d)^{2}+e,\,\!}$

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

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

### 证明

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

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

## 例子

### 具体例子

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

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

${\displaystyle y=5x^{2}+7x-6}$

### 微积分例子

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

${\displaystyle 9x^{2}-90x+241=9(x^{2}-10x)+241}$

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

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

### 复数例子

${\displaystyle |z|^{2}-b^{*}z-bz^{*}+c}$

${\displaystyle |z-b|^{2}-|b|^{2}+c}$

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

${\displaystyle ax^{2}+by^{2}+c}$

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

{\displaystyle {\begin{aligned}|z|^{2}&{}=zz^{*}\\&{}=({\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^{2}by^{2}\\&{}=ax^{2}+by^{2},\end{aligned}}}

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

## 方法的变化

### 例子：正数与它的倒数的和

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

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

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

${\displaystyle (x^{2})^{2}+(18)^{2}}$

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