# 有理函數

$f(x)=\frac{a_m x^m+a_{m-1} x^{m-1}+\cdots +a_1x+a_0}{b_n x^n+b_{n-1} x^{n-1}+\cdots +b_1x+b_0} = \frac{P_m(x)}{Q_n(x)} \quad ; \quad m, n \in \mathbb{N}_0$$b_i$不全為0。

## 漸近線

• 不失一般性可假設分子、分母互質。若存在$r>0$，使得$(px+q)^r$是分母$Q(x)$的因子，則有理函數存在垂直漸近線$x=-q/p$
• $m，有水平漸近線$y=0$
• $m=n$，有水平漸近線$y=\frac{a_m}{b_m}$
• $m=n+1$，有斜漸近線$y=\frac{a_m}{b_n} x + \frac{b_n*a_{m-1} - b_{n-1}*a_m}{{b_n}^2}$

## 部分分式

### 例子

1. 分拆$\frac{x^3 - 5x +88}{x^2 + 3x - 28}$

$x-3 + \frac{32 x+4}{x^2 + 3x - 28}$

$\frac{32 x+4}{x^2 + 3x - 28} = \frac{A}{x+7} + \frac{B}{x-4}$

$\ 32x + 4 = A(x-4) + B(x+7)$

$\ 32x + 4 = (A+B)x + (7B-4A)$

$\ A + B = 32$

$\ 7B - 4A = 4$

$\ 128 + 4 = 11B$

$\ B = 12$

$\ -224 + 4 = -11A$

$\ A = 20$

## 積分

### 部分分數

• 分母為1次多項式：求$\int \frac{1}{ax+b} dx$

$u=ax+b$

$\frac{du}{dx} = a$
$\frac{du}{a} = dx$

$\int \frac{1}{u} \frac{du}{a} = \frac{1}{a} \int \frac{1}{u} {du} = \frac{\ln\left|u\right|}{a} + C = \frac{\ln\left|ax+b\right|}{a} + C$
• 分母次數為2：求$\int \frac{dx+e}{ax^2+bx+c} dx$

$\int {x+6 \over x^2-8x+25}\,dx.$

$x^2-8x+25=(x^2-8x+16)+9=(x-4)^2+9\,$

$u=x^2-8x+25\,$
$du=(2x-8)\,dx$
$du/2=(x-4)\,dx$

$\int {x-4 \over x^2-8x+25}\,dx + \int {10 \over x^2 - 8x + 25} \, dx$

$\int {x-4 \over x^2-8x+25}\,dx = \int {du/2 \over u} = {1 \over 2}\ln\left|u\right|+C = {1 \over 2}\ln(x^2-8x+25)+C$

$\int {10 \over x^2-8x+25} \, dx = \int {10 \over (x-4)^2+9} \, dx = \int {10/9 \over \left({x-4 \over 3}\right)^2+1}\,dx$

$w=(x-4)/3\,$
$dw=dx/3\,$
${10 \over 3}\int {dw \over w^2+1} = {10 \over 3} \arctan(w)+C={10 \over 3} \arctan\left({x-4 \over 3}\right)+C.$

$\tan\theta={x-4 \over 3},\,$
$\left({x-4 \over 3}\right)^2+1=\tan^2\theta+1=\sec^2\theta,\,$
$d\tan\theta=\sec^2\theta\,d\theta={dx \over 3}.\,$

$\int {10/9 \over \left({x-4 \over 3}\right)^2+1}\,dx = 10/9 \int \frac{1}{\sec^2 \theta} 3 \sec^2 \theta \, d\theta = {10 \over 3} \arctan\left({x-4 \over 3}\right)+C$

### 奧斯特洛格拉德斯基方法

$\int \frac{P}{Q} dx = \frac{P_1}{Q_1} + \int \frac{P_2}{Q_2} dx$

#### 應用例子

• $\int \frac{x dx}{(x-1)^2 (x+1)^3}$
1. $Q = (x-1)^2 (x+1)^3$
2. $Q' = 2(x-1)(x+1)^3 + 3(x-1)^2 (x+1)^2 = (x-1)(x+1)^2 ( 5x-1 )$
3. $Q_1 = gcd(Q,Q') = (x-1)(x+1)^2$
4. $Q_2 = Q/Q_1 = (x-1)(x+1)$

$P_1 = Ax^2 + Bx + C , \quad P_2 = Dx + E$

$\int \frac{x dx}{(x-1)^2 (x+1)^3} = \frac{Ax^2 + Bx + C}{(x-1)(x+1)^2} + \int \frac{Dx + E}{(x-1)(x+1)} dx$

$\frac{x}{(x-1)^2 (x+1)^3} = \frac{A x^3 + (2 B - A) x^2 + (3 C - B + 2 A) x - C + B}{ (x-1)^2 (x+1)^3 } + \frac{Dx + E}{(x-1)(x+1)}$

$D x^4 + (E + D - A) x^3 + (E - D - 2 B + A) x^2 + (- E - D - 3 C + B - 2 A) x - E + C - B$

$\int \frac{x dx}{(x-1)^2 (x+1)^3} = \frac{x^2 + x + 2}{8(1-x)(x+1)^2} + \int \frac{dx}{8(x-1)(x+1)}$

#### 證明

$\int \frac{P}{Q} dx = \frac{P_1}{Q_1} + \int \frac{P_2}{Q_2} dx$
$\frac{P}{Q} = \frac{P'_1 - \frac{Q'_1 P_1}{Q_1} }{Q_1} + \frac{P_2}{Q_2}$

$P = P'_1 Q_2 - \frac{Q'_1 Q_2 P_1}{Q_1} + P_2 Q_1$

• $\deg(P) \le \deg(Q)-1$
• $\deg(P'_1 Q_2 \le (\deg(Q_1)-1) + (\deg(Q)-\deg(Q_1)) = \deg(Q)-1$
• $\deg(\frac{Q'_1 Q_2 P_1}{Q_1}) \le (deg(Q_1)-1) + (\deg(Q)-\deg(Q_1)) + ( \deg(Q_1) - 1 ) - \deg(Q_1) = \deg(Q) - 2$
• $\deg(P_2 Q_1) \le (\deg(Q) - \deg(Q_1) - 1) + \deg(Q_1) = \deg(Q)-1$