Integration of rational functions

    Q: What is a rational function?

    A: The quotient of two polynomials

    A rational function (in variable 18-NOV - 图1, with real coefficients) is a quotient 18-NOV - 图2%20%3D%20p(x)%2Fq(x)#card=math&code=R%28x%29%20%3D%20p%28x%29%2Fq%28x%29&id=KAqfq) of two polynomials 18-NOV - 图3%2C%20q(x)#card=math&code=p%28x%29%2C%20q%28x%29&id=TZTbI) . So the domain of 18-NOV - 图4#card=math&code=R%28x%29&id=ffo1I) is all (real) 18-NOV - 图5 such that 18-NOV - 图6%20%5Cneq%200#card=math&code=q%28x%29%20%5Cneq%200&id=zmK50).

    To compute 18-NOV - 图7%7D%7Bq(x)%7D%20dx#card=math&code=%5Cint%20%5Cfrac%7Bp%28x%29%7D%7Bq%28x%29%7D%20dx&id=csG8u) , one uses the technique of “partial fraction decomposition”. It is based on the following observations.

    1. We can factorize a real-coefficient polynomial 18-NOV - 图8#card=math&code=q%28x%29&id=o3D1F) into irreducible factors.
    2. Irrducible polynomials with real coeffcients are either of degree one, or of degree two and with negative discriminant. (Recall that the discriminant of a quadratic polynomial 18-NOV - 图9 is equal to 18-NOV - 图10.)
    3. The above means

    18-NOV - 图11%20%3D%20%5Calpha%20l_1(x)%20l_2(x)%20%5Cldots%20l_m(x)%20s_1(x)%5Ccdots%20s_n(x)#card=math&code=q%28x%29%20%3D%20%5Calpha%20l_1%28x%29%20l_2%28x%29%20%5Cldots%20l_m%28x%29%20s_1%28x%29%5Ccdots%20s_n%28x%29&id=tDciH), where 18-NOV - 图12 are integers, and 18-NOV - 图13%2C%20%5Cdeg%20s_j%20%3D2%20(1%20%5Cleq%20j%20%5Cleq%20n)#card=math&code=%5Cdeg%20l_i%20%3D%201%20%281%20%5Cleq%20i%20%5Cleq%20m%29%2C%20%5Cdeg%20s_j%20%3D2%20%281%20%5Cleq%20j%20%5Cleq%20n%29&id=UUCDR), and all discriminants of 18-NOV - 图14#card=math&code=s_j%28x%29&id=LbrvF) are 18-NOV - 图15.

    So that the degree of 18-NOV - 图16#card=math&code=q%28x%29&id=TPySS) is 18-NOV - 图17. Here 18-NOV - 图18 is the leading coefficient of 18-NOV - 图19#card=math&code=q%28x%29&id=DVduL). (It implies that 18-NOV - 图20%20%3D%20%5Calpha%20x%5E%7Bm%2B2n%7D%2B#card=math&code=q%28x%29%20%3D%20%5Calpha%20x%5E%7Bm%2B2n%7D%2B&id=v3J8r) lower degree terms)

    The partial fraction decomposition is the process to write a rational function 18-NOV - 图21%3Dp(x)%2Fq(x)#card=math&code=R%28x%29%3Dp%28x%29%2Fq%28x%29&id=FL3BP) into simple summands. Suppose 18-NOV - 图22#card=math&code=q%28x%29&id=N17xk) has the been factorized as above. For simplicity we assume that 18-NOV - 图23. Then,

    18-NOV - 图24%20%3D%20%5Cfrac%7Bp(x)%7D%7Bq(x)%7D%3D%20%5Csum%7Bi%3D1%7D%5Em%20%5Cfrac%7BC_i%7D%7Bl_i(x)%7D%20%2B%20%5Csum%7Bj%20%3D1%7D%5En%20%5Cfrac%7BAj%20x%20%2B%20B_j%7D%7Bs_j(x)%7D%0A#card=math&code=R%28x%29%20%3D%20%5Cfrac%7Bp%28x%29%7D%7Bq%28x%29%7D%3D%20%5Csum%7Bi%3D1%7D%5Em%20%5Cfrac%7BCi%7D%7Bl_i%28x%29%7D%20%2B%20%5Csum%7Bj%20%3D1%7D%5En%20%5Cfrac%7BA_j%20x%20%2B%20B_j%7D%7Bs_j%28x%29%7D%0A&id=JZljD)

    We clear the denominator by multiplying 18-NOV - 图25#card=math&code=q%28x%29&id=UMCIo) on both sides of (1): then

    18-NOV - 图26%20%3D%20%5Csum%7Bi%3D1%7D%5Em%20%20C_i%20%5Cfrac%7Bq(x)%7D%7Bl_i(x)%7D%20%2B%20%5Csum%7Bj%3D1%7D%5En%20(Aj%20x%2B%20B_j)%5Cfrac%7Bq(x)%7D%7Bs_j(x)%7D#card=math&code=p%28x%29%20%3D%20%5Csum%7Bi%3D1%7D%5Em%20%20Ci%20%5Cfrac%7Bq%28x%29%7D%7Bl_i%28x%29%7D%20%2B%20%5Csum%7Bj%3D1%7D%5En%20%28A_j%20x%2B%20B_j%29%5Cfrac%7Bq%28x%29%7D%7Bs_j%28x%29%7D&id=h3bjr).

    Now we re-organise the terms on both sides by decreasing order of 18-NOV - 图27. Then we compare the coefficients on both sides, that we can determine the constants 18-NOV - 图28.

    Example: 18-NOV - 图29%3D%5Cfrac%7Bx%7D%7Bx%5E3-1%7D#card=math&code=R%28x%29%3D%5Cfrac%7Bx%7D%7Bx%5E3-1%7D&id=ZmjRD) 18-NOV - 图30%3Dx%5E3-1%20%3D%20(x-1)(x%5E2%2Bx%2B1)#card=math&code=q%28x%29%3Dx%5E3-1%20%3D%20%28x-1%29%28x%5E2%2Bx%2B1%29&id=E53lV) .

    18-NOV - 图31, clearing the denominator, we get

    18-NOV - 图32%2B(Ax%2BB)(x-1)%20%3D%20(C%2BA)x%5E2%2B(C-A%2BB)x%20%2B(C-B)#card=math&code=x%20%3D%20C%28x%5E2%2Bx%2B1%29%2B%28Ax%2BB%29%28x-1%29%20%3D%20%28C%2BA%29x%5E2%2B%28C-A%2BB%29x%20%2B%28C-B%29&id=CpWMB) .

    Comparing the coefficients, we see that

    18-NOV - 图33 .

    Thus 18-NOV - 图34 . So we have

    18-NOV - 图35#card=math&code=%5Cfrac%7Bx%7D%7Bx%5E3-1%7D%20%3D%20%5Cfrac%7B1%2F3%7D%7Bx-1%7D%2B%5Cfrac%7B-x%2F3%2B1%2F3%7D%7Bx%5E2%2Bx%2B1%7D%20%3D%20%5Cfrac%7B1%7D%7B3%7D%20%5Cbig%28%20%5Cfrac%7B1%7D%7Bx-1%7D%2B%20%5Cfrac%7B-x%2B1%7D%7Bx%5E2%2Bx%2B1%7D%5Cbig%29&id=oeh9b)

    Now we can simplify the integral: 18-NOV - 图36#card=math&code=%5Cint%20%5Cfrac%7Bx%7D%7Bx%5E3-1%7D%20dx%20%3D%20%5Cfrac%7B1%7D%7B3%7D%5Cbig%28%20%5Cint%20%5Cfrac%7Bdx%7D%7Bx-1%7D%20%2B%20%5Cint%20%5Cfrac%7B1-x%7D%7Bx%5E2%2Bx%2B1%7D%20dx%20%5Cbig%29&id=iCZMF).

    In general, we have

    18-NOV - 图37

    Recall that 18-NOV - 图38%3D1#card=math&code=%5Cdeg%20l_i%28x%29%3D1&id=wOUmC), so that we can write 18-NOV - 图39%20%3D%20%5Cbeta_i%20x%20%2B%20%5Cgamma_i#card=math&code=l_i%28x%29%20%3D%20%5Cbeta_i%20x%20%2B%20%5Cgamma_i&id=zcyrc) . So that it is enough to know how to compute 18-NOV - 图40 . And we know that
    18-NOV - 图41%7D%7B%5Cbeta%20x%20%2B%20%5Cgamma%7D%20%3D%20%5Cfrac%7B1%7D%7B%5Cbeta%7D%20%5Cln%20%7C%5Cbeta%20x%20%2B%20%5Cgamma%7C%20%2BC#card=math&code=%5Cint%20%5Cfrac%7Bd%20x%7D%7B%5Cbeta%20x%20%2B%20%5Cgamma%7D%20%3D%20%5Cfrac%7B1%7D%7B%5Cbeta%7D%20%5Cint%20%5Cfrac%7Bd%28%5Cbeta%20%20x%2B%5Cgamma%29%7D%7B%5Cbeta%20x%20%2B%20%5Cgamma%7D%20%3D%20%5Cfrac%7B1%7D%7B%5Cbeta%7D%20%5Cln%20%7C%5Cbeta%20x%20%2B%20%5Cgamma%7C%20%2BC&id=gNivD)

    Now we look at the quadratic terms.

    Suppose 18-NOV - 图42. We need to compute 18-NOV - 图43.

    We observe that 18-NOV - 图44‘%20%3D%202ax%2Bb#card=math&code=%28ax%5E2%20%2B%20bx%2Bc%29%27%20%3D%202ax%2Bb&id=Sk0wA) .

    18-NOV - 图45(2ax%2Bb%2B2aB%2FA-b)%7D%7Bax%5E2%2Bbx%2Bc%7D%20%3D%20%5Cfrac%7BA%7D%7B2a%7D%20%5Cfrac%7B2ax%2Bb%7D%7Bax%5E2%2Bbx%2Bc%7D%20%2B%20%5Cfrac%7BB-bA%2F2a%7D%7Bax%5E2%2Bbx%2Bc%7D#card=math&code=%5Cfrac%7BAx%2BB%7D%7Bax%5E2%20%2B%20bx%20%2B%20c%7D%20%3D%20%5Cfrac%7B%28A%2F2a%29%282ax%2Bb%2B2aB%2FA-b%29%7D%7Bax%5E2%2Bbx%2Bc%7D%20%3D%20%5Cfrac%7BA%7D%7B2a%7D%20%5Cfrac%7B2ax%2Bb%7D%7Bax%5E2%2Bbx%2Bc%7D%20%2B%20%5Cfrac%7BB-bA%2F2a%7D%7Bax%5E2%2Bbx%2Bc%7D&id=Xl7s5) (we change 18-NOV - 图46 into 18-NOV - 图47. )

    So that we turn to compute 18-NOV - 图48

    the first summand is easy: 18-NOV - 图49%7D%7Bax%5E2%2Bbx%2Bc%7D%20%3D%20%5Cln%20%7Cax%5E2%2Bbx%2Bc%7C%2BC’#card=math&code=%5Cint%20%5Cfrac%7B2ax%2Bb%7D%7Bax%5E2%2Bbx%2Bc%7D%20dx%20%3D%20%5Cint%20%5Cfrac%7Bd%20%28ax%5E2%2Bbx%2Bc%29%7D%7Bax%5E2%2Bbx%2Bc%7D%20%3D%20%5Cln%20%7Cax%5E2%2Bbx%2Bc%7C%2BC%27&id=vgHiS) .

    Now the second summand: 18-NOV - 图50 .

    the disc of 18-NOV - 图51 is 18-NOV - 图52. So it means that no real root for 18-NOV - 图53.

    Firstly we complete the quadratic polynomial into a complete square:
    18-NOV - 图54

    [Aside: Where comes out the discriminant? 18-NOV - 图55%5E2%20%3D%20%5Cfrac%7Bb%5E2-4ac%7D%7B4a%5E2%7D#card=math&code=ax%5E2%2Bbx%2Bc%3D0%20%20%5CLeftrightarrow%20%28x%2B%5Cfrac%7Bb%7D%7Ba%7D%29%5E2%20%3D%20%5Cfrac%7Bb%5E2-4ac%7D%7B4a%5E2%7D&id=uT25l) The LHS is 18-NOV - 图56 So that if there is an equation, then the RHS must be also 18-NOV - 图57. This is equivalent to say that the discriminant 18-NOV - 图58 must be 18-NOV - 图59. ]

    18-NOV - 图60%5E2%20%2B%20%5Cfrac%7B4ac-b%5E2%7D%7B4a%5E2%7D#card=math&code=%28x%2B%5Cfrac%7Bb%7D%7B2a%7D%29%5E2%20%2B%20%5Cfrac%7B4ac-b%5E2%7D%7B4a%5E2%7D&id=PiwJy) in the denominator, and the numerator is 18-NOV - 图61. We first look at the formula

    18-NOV - 图62

    Now we use the formula (2) to find out

    18-NOV - 图63%5E2%20%2B%20%5Cfrac%7B4ac-b%5E2%7D%7B4a%5E2%7D%7D%3D%5Cfrac%7B4a%7D%7B4ac-b%5E2%7D%5Cint%20%5Cfrac%7Bdx%7D%7B1%2B%5Cbig(%5Cfrac%7B2ax%2Bb%7D%7B%5Csqrt%7B4ac-b%5E2%7D%7D%5Cbig)%5E2%7D%0A#card=math&code=%5Cfrac%7B1%7D%7Ba%7D%5Cint%20%5Cfrac%7Bdx%7D%7B%28x%2B%5Cfrac%7Bb%7D%7B2a%7D%29%5E2%20%2B%20%5Cfrac%7B4ac-b%5E2%7D%7B4a%5E2%7D%7D%3D%5Cfrac%7B4a%7D%7B4ac-b%5E2%7D%5Cint%20%5Cfrac%7Bdx%7D%7B1%2B%5Cbig%28%5Cfrac%7B2ax%2Bb%7D%7B%5Csqrt%7B4ac-b%5E2%7D%7D%5Cbig%29%5E2%7D%0A&id=SXpRX)

    we let 18-NOV - 图64#card=math&code=u%20%3D%20%5Cbig%28%5Cfrac%7B2ax%2Bb%7D%7B%5Csqrt%7B4ac-b%5E2%7D%7D%5Cbig%29&id=PXEH6) then 18-NOV - 图65

    Then 18-NOV - 图66

    the final formula is

    18-NOV - 图67%2BC%2C%20%5Cquad%20b%5E2%20%3C%204ac%0A#card=math&code=%5Cint%20%5Cfrac%7Bdx%7D%7Bax%5E2%2Bbx%2Bc%7D%20%3D%20%5Cfrac%7B2%7D%7B%5Csqrt%7B4ac-b%5E2%7D%7D%5Carctan%20%5Cbig%28%5Cfrac%7B2ax%2Bb%7D%7B%5Csqrt%7B4ac-b%5E2%7D%7D%5Cbig%29%2BC%2C%20%5Cquad%20b%5E2%20%3C%204ac%0A&id=fX8Qg)

    Moreover, if in the indefinite integral 18-NOV - 图68%20dx#card=math&code=%5Cint%20R%28x%29%20dx&id=QC47O), some 18-NOV - 图69 is replaced by 18-NOV - 图70 or 18-NOV - 图71 or both, we then need to compute 18-NOV - 图72%20%20d%20%5Ctheta#card=math&code=%5Cint%20R%28%5Csin%20%5Ctheta%2C%20%5Ccos%20%5Ctheta%29%20%20d%20%5Ctheta&id=OKT4q) . The trick is using the universal substitution: we let 18-NOV - 图73#card=math&code=t%20%3D%20%5Ctan%20%28%5Ctheta%2F2%29&id=kADZP). Then 18-NOV - 图74. 18-NOV - 图75 We still have a rational function (in 18-NOV - 图76) !

    Updated 18-Nov-2021 18:26: the above discussion over partial fraction decomposition, does not include one important case: namely, there might be some irreducible factors of 18-NOV - 图77 occur of multiplicity higher than one! We shall discuss this case next week.