Mathematics for Chemistry/Integration

From testwiki
Revision as of 18:55, 10 July 2014 by 132.199.99.15 (talk) (Integration by parts)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Free Web Based Material from HEFCE

There is a DVD on integration at Math Tutor.

The basic polynomial

f(x)=xn

f(x)dx=xn+1n+1+c

This works fine for all powers except -1, for instance the integral of

1x7

is just

16x6+c

-1 is clearly going to be a special case because it involves an infinity when x=0 and goes to a steep spike as x gets small. As you have learned earlier this integral is the natural logarithm of x and the infinity exists because the log of zero is minus infinity and that of negative numbers is undefined.

The integration and differentiation of positive and negative powers

   >>>>>>>>>>>>>>>>>>>>>>Differentiation

   1/3 x*x*x  x*x       2x        2         0        0       0       0

   1/3 x*x*x  x*x       2x        2         ?        ?       ?       ?

   Integration<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

   I(x)        H(x)     G(x)      F(x)      ln(x)   1/x    -1/(x*x)


Here I, H, G and F are more complicated functions involving lnx.

You will be able to work them out easily when you have done more integration. The thing to notice is that the calculus of negative and positive powers is not symmetrical, essentially caused by the pole or singularity for 1xn at x=0.

Logarithms

Logarithms were invented by Napier, a Scottish Laird, in the 17th-century. He made many inventions but his most enduring came from the necessity of doing the many long divisions and trigonometric calculations used in astronomy. The Royal Navy in later years devoted great time and expense to developing logarithm technology for the purposes of navigation, leading to the commissioning of the first mechanical stored program computer, which was theoretically sound but could not be made by Charles Babbage between 1833 and 1871.

The heart of the system is the observation of the properties of powers:

eaeb=eab

This means that if we have the inverse function of ex we can change a long division into a subtraction by looking up the exponents in a set of tables. Before the advent of calculators this was the way many calculations were done.

y=ex

lny=x

Napier initially used logs to the base e for his calculations, but after a year or so he was visited by Briggs who suggested it would be more practical to use base 10. However base e is necessary for the purposes of calculus and thermodynamics.

Integrating 1/x

x=eydxdy=eyalso=x

This is true because ey is our function which reduces or grows at the rate of its own quantity.

y=lnx

This is our definition of a logarithm.

dxdy=1dydxalso=x

therefore

dydx=1x

dydxdx=y

therefore

1xdx=lnx

Integrating 1/x like things

Just as

ddxlnx=1x

so

ddxlnu=1ududx

therefore by the chain rule

ddxlnf(x)=f'(x)f(x)

therefore

f'(x)f(x)dx=ln|f(x)|+c

Examples of this are:

cosϕ1+sinϕdϕ=ln(1+sinϕ)+c

or

sinϕ1+cosϕdϕ=ln(1+cosϕ)+c

and

eyey+2dy=ln(ey+2)+c

As the integral of 1/x is ln so the differential of ln is 1/x so

ddxln5x3=ln5+lnx3=ln5+3lnx

ln5 is just a constant so ddx=0 so

ddxln5x3=3x

This can also be done by the chain rule

ddxln5x3=15x3.d(5x3)dx=15x25x3=3x

What is interesting here is that the 5 has disappeared completely. The gradient of the log function is unaffected by a multiplier! This is a fundamental property of logs.

Some observations on infinity

Obviously 10 is .

00nd are undefined but sometimes a large number over a large number can have defined values. An example is the sin of 90 degrees, which you will remember has a large opposite over a large hypotenuse but in the limit of an infinitesimally thin triangle they become equal. Therefore the sin is 1.

Definite integrals (limits)

Remember how we do a definite integral

03(f(x))=[F(x)]03=F(3)F(0)

where F is the indefinite integral of f.

Here is an example where limits are used to calculate the 3 areas cut out by a quartic equation:

x42x3x2+2x.

We see that x=1 is a solution so we can do a polynomial division:


        x3  -x2 -2x
      -------------------
 x-1  ) x4 -2x3 -x2 +2x
        x4  -x3
       --------
            -x3 -x2
            -x3 +x2
            -------
                -2x2 +2x
                -2x2 +2x
                --------
                     0

So the equation is x(x2x2)(x1) which factorises to

x(x2)(x+1)(x1).

abx42x3x2+2x=[x5/5x4/2x3/3+x2]ab

Integration by substitution

sinθcosθdθ=ududθdθ

where u=sinθ.

sinθcosθdθ=sin2θ2+c

sin9θcosθdθsimilarly=sin10θ10+c

Simple integration of trigonometric and exponential Functions

4e2xdx

9e3xdx

sin2θdθ

sin2θ+cos2θdθ

cosϕdϕ

Answers

2e2x+c

3e3x+c

12cos2θ+c

θ+c

i.e. the integral of 1dθ.

sinϕ+c

Integration by parts

This is done in many textbooks and Wikipedia. Their notation might be different to the one used here, which hopefully is the most clear. You derive the expression by taking the product rule and integrating it. You then make one of the UV' into a product itself to produce the expression.

UV=UV(U'V)

(all integration with respect to x. Remember by

UV=U[int][diff][int]

(U gets differentiated.)

The important thing is that you have to integrate one expression of the product and differentiate the other. In the basic scheme you integrate the most complicated expression and differentiate the simplest. Each time you do this you generate a new term but the function being differentiated goes to zero and the integral is solved. The expression which goes to zero is U.

The other common scheme is where the parts formula generates the expression you want on the right of the equals and there are no other integral signs. Then you can rearrange the equation and the integral is solved. This is obviously very useful for trig functions where sincossincossin ad infinitum.

ex also generates itself and is susceptible to the same treatment.

exsinxdx=(ex)sinx(ex)cosxdx

=exsinx+excosxdx

=ex(sinx+cosx)exsinxdx+c

We now have our required integral on both sides of the equation so

=12ex(sinx+cosx)+c

Integration Problems

Integrate the following by parts with respect tox.

xex

x2sinx

xcosx

x2ex

x2lnx

exsinx

e2xcosx

x(1+x)7

Actually this one can be done quite elegantly by parts, to give a two term expression. Work this one out. Expanding the original integrand by Pascal's Triangle gives:

         2       3       4       5       6      7    8
  x + 7 x  + 21 x  + 35 x  + 35 x  + 21 x  + 7 x  + x


The two term integral expands to

      2        3         4      5         6      7        8        9
 1/2 x  + 7/3 x  + 21/4 x  + 7 x  + 35/6 x  + 3 x  + 7/8 x  + 1/9 x  - 1/72

So one can see it is correct on a term by term basis.

3xsinx

2x2cos2x

If you integrate x7sinx you will have to apply parts 7 times to get x to become 1 thereby generating 8 terms:



    7             6              5               4               3
  -x  cos(x) + 7 x  sin(x) + 42 x  cos(x) - 210 x  sin(x) - 840 x  cos(x) +

        2
  2520 x  sin(x) +  5040 x cos(x) - 5040 sin(x)  + c


(Output from Maple.) 

Though it looks nasty there is quite a pattern to this, 7, 7x6,7x6x5 ------7! and sin, cos, -sin, -cos, sin, cos etc so it can easily be done by hand.

Differential equations

First order differential equations are covered in many textbooks. They are solved by integration. (First order equations have dydx, second order equations have dydx and d2ydx2.)

The arbitrary constant means another piece of information is needed for complete solution, as with the Newton's Law of Cooling and Half Life examples.

Provided all the xs can be got to one side and the ys to another the equation is separable.

2ydydx=6x2

2ydy=6x2dx

y2=2x3+c

This is the general solution.

Typical examples are:

y=xdydxdyy=dxx

lny=lnx+lnA(constant)i.e.y=Ax

by definition of logs.

dydx=ky (1)

kxy=dydx

dyy=kxdx (2)

lny=12kx2+A (3)

This corresponds to:

y=Be12kx2

The Schrödinger equation is a 2nd order differential equation e.g. for the particle in a box

22md2Ψdx2+EΨ=0

It has taken many decades of work to produce computationally efficient solutions of this equation for polyatomic molecules. Essentially one expands in coefficients of the atomic orbitals. Then integrates to make a differential equation a set of numbers, integrals, in a matrix. Matrix algebra then finishes the job and finds a solution by solving the resultant simultaneous equations.

The calculus of trigonometric functions

There are many different ways of expressing the same thing in trig functions and very often successful integration depends on recognising a trig identity.

sin2xdx=12cos2x+c

but could also be

sin2xorcos2x

(each with an integration constant!).

When applying calculus to these functions it is necessary to spot which is the simplest form for the current manipulation. For integration it often contains a product of a function with its derivative like 2sinxcosx where integration by substitution is possible.

Where a derivative can be spotted on the numerator and its integral below we will get a ln function. This is how we integrate tan.

tanxdx=sinxcosxdx=ln(cosx)+c

We can see this function goes to infinity at π/2 as it should do.

Integration by rearrangement

Take for example:

cos2xdx

Here there is no sin function producted in with the cos powers so we cannot use substitution. However there are the two trig identities

cos2θ+sin2θ=1

and

cos2θsin2θ=cos2θ

Using these we have

cos2xdx=12(1+cos2x)dx

so we have two simple terms which we can integrate.

The Maclaurin series

We begin by making the assumption that a function can be approximated by an infinite power series in x:

f(x)=a0+a1x+a2x2+a3x3+a4x4+

By differentiating and setting x=0 one gets

f(x)=f(0)+f'(0)x+f'(0)2!x2+f'(0)3!x3+f'(0)4!x4+

Sin, cos and ex can be expressed by this series approximation

sinx=xx33!+x55!x77!

cosx=1x22!+x44!x66!

ex=1+x+x22!+x33!+x44!

Notice ex also works for negative x.

When differentiated or integrated ex generates itself!

When differentiated sinx generates cosx.

By using series we can convert a complex function into a polynomial, and can use sinx=xx3/6 for small x.

In actual fact the kind of approximation used inside computer programs is more like: ax2+bx+cAx2+Bx+C

These have greater range but are much harder to develop and a bit fiddly on the calculator or to estimate by raw brain power.

We cannot expand lnx this way because ln0 is

. However ln(1+x) can be expanded.

Work out the series for ln(1+x).

Factorials

The factorials you have seen in series come from repeated differentiation. n! also has a statistical meaning as it is the number of unique ways you can arrange n objects.

0! is 1 by definition, i.e. the number of different ways you can arrange 0 objects is 1.

In statistical thermodynamics you will come across many factorials in expressions such as: W=N!n0!n1!n2!...

Factorials rapidly get unreasonably large: 6! = 720, 8! = 40320 but 12! = 479001600 so we need to divide them out into reasonable numbers if possible, so for example 8!/6!=7x8.

Stirling's approximation

Also in statistical thermodynamics you will find Stirling's approximation:

lnx!xlnxx

This is proved and discussed in Atkins' Physical Chemistry.

How can you use series to estimate ln2. Notice that the series for

ln(1+x) converges extremely slowly. ex is much faster because the

n! denominator becomes large quickly.

Trigonometric power series

Remember that when you use sinx=x and cosx=1x2/2

that x must be in radians.....

Calculus revision

Problems

integrate x to the power of x with respect to x

  1. Differentiate etcos2t, with respect to t. (Hint - use the chain rule.)
  2. Differentiate x2(3x+1)4. (Chain rule and product rule here.)
  3. Differentiate ln(7x4). (Hint - split it into a sum of logs first.)
  4. Integrate lnx. (Hint - use integration by parts and take the expression to be differentiated as 1.)

Answers

  1. It is just et.2sin2tetcos2t. Bring a et out of each term to simplify to a(b+c).
  2. 2x(9x+1)(3x+1)3.
  3. ln7+4lnx - therefore it is 4 times the derivative of lnx.
  4. You should get xlnxx by 1 application of parts.

Template:BookCat