Partial fractions

Videos

Review Videos

Videos, Math Dr. Bob:

Link to original

01 Theory

Theory 1

A rational function is a ratio of polynomials, for example:

P(x)Q(x)=5x2+x28x34x2+x+6

Partial fraction decomposition

The partial fraction decomposition of a rational function is a way of writing it as a sum of simple terms, like this:

3x35x26x+20x43x3+4x=2x+1+2(x2)2+5x

Allowed denominators:

  • Linear, e.g. xa, or linear power, e.g. (xa)n
  • Quadratic, e.g. x2+bx+c, or quadratic power, e.g. (x2+bx+c)n
    • Condition: quadratics must be irreducible. (No roots, i.e. b2<4c.)

Allowed numerators: constant (over linear power) or linear (over quadratic power)

These are allowed as simple terms in partial fraction decompositions:

1x2+1,2x+1x2+5,75x8,1x,1x3

These are not allowed:

xx1,x3+2x2+1,1x21,1x(x1)

These are allowed, showing irreducible quadratic and higher powers:

xx2+1,x3+2x+1(x2+2)2

In this example the numerator is linear and the denominator is quadratic and irreducible.

center

To create a partial fraction decomposition, follow these steps:

  1. Check denominator degree is higher
    • Else do long division
  2. Factor denominator completely (even using irrational roots)
  3. Write the generic sum of partial fraction terms with their constants

Repeated factors – special treatment – incrementing powers

  1. Solve for constants
Link to original

02 Illustration

Partial fractions with repeated factor

Partial fractions with repeated factor

Find the partial fraction decomposition:

3x9x3+3x24

Solution

(1) Check that denominator degree is lower.


(2) Factor denominator:

Rational Roots Theorem: check for roots at ±1 and ±2 and ±4.

Discover that x=+1 is a root. Therefore divide by x1:

x3+3x24x1x2+4x+4

Factor again:

x2+4x+4(x+2)2

Final factored form:

x3+3x24=(x1)(x+2)2

(3) Write the generic PFD:

3x9(x1)(x+2)2=Ax1+Bx+2+C(x+2)2

(4) Solve for A, B, and C:

Multiply across by the common denominator:

3x9=A(x+2)2+B(x1)(x+2)+C(x1)

For A, set x=1, obtain:

319=A(1+2)2+B0+C06=9AA=2/3

For C, set x=2, obtain:

3(2)9=A0+B0+C(3)15=3CC=5

For B, insert prior results and solve.

Plug in A and C:

3x9=23(x+2)2+B(x1)(x+2)+5(x1)

Now plug in another convenient x, say x=3:

0=2352+B25+5250310=10BB=23

(4) Plug in A, B, C for the final answer:

3x9x3+3x24=2/3x1+2/3x+2+5(x+2)2 Link to original

03 Theory

Theory 2

Partial fractions can be integrated using just a few techniques. Consider these terms:

Axa,A(xa)2,A(xa)3,,andAx2+h2,andAx+Bx2+h2

Linear power bottom

In order to integrate terms like this:

A(xa)n

If n=1 then use log:

Axadx=Aln|xa|+C

If n>1 then use power rule:

A(xa)ndxA(xa)ndxA(xa)n+1n+1+C

Quadratic bottom, constant top

Formula for simple irreducible quadratics:

dxx2+h2=1htan1(xh)+C

Memorize this formula!

Quadratic bottom, linear top

In order to integrate terms like this:

Ax+Bx2+h2

Break into separate terms:

Ax+Bx2+h2Axx2+h2+Bx2+h2

Then:

  • First term with x in top:
Axx2+h2dxA2ln|x2+h2|+C
  • Second term lacking x in top:
Bx2+h2dxBhtan1(xh)+C
Link to original

04 Illustration

Example - Repeated quadratic, linear tops

Partial fractions - repeated quadratic, linear tops

Compute the integral:

x3+1(x2+4)2dx

Solution

(1) Partial fraction decomposition:

  • Numerator degree is lower than denominator.
  • Factor denominator completely. (No real roots.)

Write generic PFD:

x3+1(x2+4)2=Ax+Bx2+4+Cx+D(x2+4)2
  • Notice: repeated factor: use incrementing powers up to 2.
  • Notice: linear over quadratic.

Common denominators and solve:

x3+1=(Ax+B)(x2+4)+Cx+Dx3+1=Ax3+Bx2+(4A+C)x+4B+DA=1,B=0C=4,D=1

Therefore:

x3+1(x2+4)2=xx2+4+4x+1(x2+4)2

(2) Integrate:

Integrate the first term using substitution u=x2+4:

xx2+4dxu=x2+412duu12ln|u|+C12ln|x2+4|+C

Break up the second term:

4x+1(x2+4)24x(x2+4)2+1(x2+4)2

Integrate the first term of RHS:

4x(x2+4)2dx2duu22u+C2x2+4+C

Integrate the second term of RHS using x=2tanθ:

dx(x2+4)22sec2θdθ16sec4θ18cos2θdθ1812(1+cos(2θ))dθ116θ+132sin(2θ)+C116tan1(x2)+1322sinθcosθ+C116tan1(x2)+1322xx2+222x2+22+C116tan1(x2)+18xx2+22+CLink to original

Extra - “Rationalize a quotient” - convert into PFD

Extra - “Rationalize a quotient” - convert into PFD

Sometimes an integrand may be converted to a rational function using a substitution.

Consider this integral:

x+4xdx

Set u=x+4, so x=u24 and dx=2udu:

2uduu24

Now this rational function has a partial fraction decomposition:

2uu242u(u2)(u+2)1u2+1u+2

It is easy to integrate from there!

Practice exercises:

  • To compute xx1dx, try the substitution u=x.
  • To compute dxx2x3, try the substitution u=x6.
  • To compute 1xx+2dx, try the substitution u=x+2.
Link to original

Simpson’s Rule

Videos

Review Videos

Videos, Math Dr. Bob:

Videos, Organic Chemistry Tutor:

Link to original

05 Theory - review

Theory 1

The Trapezoid Rule is a technique to approximate the area under a curve as the sum of areas of thin trapezoids whose top corners lie on the curve.

center The tops of the trapezoids are lines that approximate the curve. They are determined as lines that agree with the curve at two points.

Trapezoid rule - area formula

Given a function f and a partition of the range [a,b] labeled by x0,x1,,xn (with x0=a and xn=b), the Trapezoid Rule determines the area formula:

Tn=12Δx(y0+2y1+2y2++2yn1+yn)

Notice the pattern in 2s and see how this formula comes about: The area of one trapezoid is Δx(yj1+yj2). All vertical values y1,,yn1 (excepting the endpoints f(a) and f(b)) are represented in two trapezoids, so their contribution is doubled.

Extra - Trapezoid rule - error bound

The error of the Trapezoid Rule approximation is bounded by this formula:

Error(Tn)K2(ba)312n2

Here K2 is any number satisfying K2|f(x)| for x[a,b].

The Midpoint Rule is a technique to approximate the area under a curve as the sum of areas of thin rectangles whose top midpoints lies on the curve.

center

The very same formula also represents the areas of trapezoids whose top midpoints lie on the curve and whose top line is tangent to the curve:

center

The reason they are equal is simple: when pivoting the top line on the ‘attached’ midpoint, the area of the trapezoid does not change.

Midpoint Rule - area formula

Given a function f and a partition of the range [a,b] labeled by x0,x1,,xn (with x0=a and xn=b), the Midpoint Rule determines the area formula:

Mn=Δx(f(c1)+f(c2)++f(cn1)+f(cn))

Here each ci is the midpoint of the interval [xi1,xi]. It can be given by the formula ci=a+(i1/2)Δx.

Extra - Midpoint Rule - error bound

The error of the Midpoint Rule approximation is bounded by this formula:

Error(Mn)K2(ba)324n2

Here K2 is any number satisfying K2|f(x)| for x[a,b].

Notice that Mn has an error bound that is 1/2 of the bound for Tn. This does not mean that Mn always has a smaller error than Tn. It means that without calculating the error, simply plugging numbers into the error bound formulas, we obtain a smaller bound for Mn than for Tn. This is about our knowledge of the error, not the reality of the error.

Link to original

06 Theory

Theory 2

It turns out that the Midpoint Rule and the Trapezoid Rule tend to differ from the exact integral in opposite directions, and the Midpoint Rule tends to be twice as accurate. Therefore we may improve on both of them by constructing a weighted average of the formulas. This is called Simpson’s Rule.

center

Simpson’s Rule - defining formula

Simpson’s Rule is given by the weighted sum of the Trapezoid and Midpoint Rules:

Sn=12Tn+23Mn

Simpson’s Rule - computing formula

Given a function f and a partition of the range [a,b] labeled by x0,x1,,xn (with x0=a and xn=b), Simpson’s Rule determines the area formula:

Sn=13Δx(y0+4y1+2y2+4y3+2y4++2yn2+4yn1+yn)

Simpson’s Coefficient Pattern

Memorize the pattern for Simpson’s Rule:

1,4,2,4,2,4,2,,1

Simpson’s Rule - error bound

The error of Simpson’s Rule approximation is bounded by this formula:

Error(Sn)K4(ba)5180n4

Here K4 is any number satisfying K4|f(4)(x)| for x[a,b].

Simpson’s Rule = “Parabola Rule”

The formula of Simpson’s Rule can also be explained or defined geometrically: it is the formula giving the sum of areas under small parabolas that meet the curve in three points.

There is a unique parabola passing through any three points with differing x-values: center

These may be pieced together to form an approximation to the curve: center The area under the parabola through P0, P1, and P2 is given by this formula:

h3(y0+4y1+y2)

This formula may be verified using basic calculus (area under a parabola) and a lot of algebra. (Ambitious students should derive it.)

The area under the parabola through P2, P3, and P4 is given by a similar formula:

h3(y2+4y3+y4)

The Simpson’s Rule formula is the sum of all these formulas! So the 2s in Simpson’s come from duplication of endpoint terms as the “rectangular” regions are stacked end-to-end.

Link to original

07 Illustration

Example - Simpson’s Rule on the Gaussian Distribution

Simpson’s Rule on the Gaussian distribution

The function ex2 is very important for probability and statistics, but it cannot be integrated analytically.

Apply Simpson’s Rule to approximate the integral:

01ex2dx

with Δx=0.1 and n=10. What error bound is guaranteed for this approximation?

Solution

(1) We need a table of values of xi and yi=f(xi):

xi:0.00.10.20.30.40.50.60.70.80.91.0
f(xi):e0.02e0.12e0.22e0.32e0.42e0.52e0.62e0.72e0.82e0.92e1.02
1.0001.0101.0411.0941.1741.2841.4331.6321.8962.2482.718

These can be plugged into the Simpson Rule formula to obtain our desired approximation:

S10=130.1(1.000+41.010+21.041+41.094++21.896+42.248+2.718)1.463

To find the error bound we need to find the smallest number we can manage for K4.

Take four derivatives and simplify:

f(4)(x)=(12+48x2+16x4)ex2

On the interval x[0,1], this function is maximized at x=1. Use that for the optimal K4:

f(4)(1.000)=206.589

Finally we plug this into the error bound formula:

K4(ba)5180n4=206.5891.00051801040.0001 Error(S10)0.0001Link to original