June27.mws

Today we talked about the "second version" of the fundamental theorem of calculus. If we assume that f is continuous on [a,b] and take any c in the interval and define A(x) = int(f(t),t = c .. x) then we know D(A)(x) = f(x) . Now if P is any other function with the property that D(P)(x) = f(x) for all x in (a,b) then D(A-P) = 0 so A-P is a constant function. We can phrase this in the language of differential equations as follows: If y[1], y[2] are any two solutions to the differential equation dy/dx = f(x) then they differ by a constant. Let's look at what this says graphically.

> with(DEtools):

> f:=x->x+sin(x^2);

f := proc (x) options operator, arrow; x+sin(x^2) e...

> DE:=D(y)(x)=f(x);

DE := D(y)(x) = x+sin(x^2)

> dfieldplot(DE,y(x),x=-3..3,y=-3..3,arrows=thick,color=f(x));

[Maple Plot]

Note that any two arrows with the same x value have the same slope (color) and the solution curves are parallel...in other words they differ by a constant. .

We then talked about the implementation of symbolic differentiation versus the implementation of symbolic integration. (By "symbolic" we mean an algorithmic implementation of the process, probably with a computer).

Differentiation is straightforward. If we can "type" in a expression, then we can "parse" the expression into what we might call an expression tree. For example,
sin(x^2)+x*cos(x) parses as a sum of two terms. The first term parses as a composition of the sin function and the squaring function, and the second term parses as a product of two basic objects. So by simply looking at the parsing of the expression, we can proceed to differentiate the expression.

Integration is not so simple. Look at these:
int(ln(t^2),t) and int(exp(t^2),t) .

Both of these "parse" in a similar fashion, namely in the form of a composition, each part of which we know how to integrate. Yet the methods for integrating these two integrals are completely different, in spite of the similar parsing. This is why integration is to some extent an "art". Lots of people enjoy the intellectual challenge of integration. I have never met anybody who thinks differentiation is intellectually challenging!

The fact that we can implement the "art" of integration with software is a minor triumph of artificial intelligence. Most implementations make use of what is called the Risch algorithm. This dates to about 1970. Before this date many people thought that integration would always remain an non-algorithmic art. Even with the appearance of the algorithm, it took several years before software interfaces could implement the algorithm effectively. Math software in the decade or two after 1970 tended to be numerical based: an object like
sqrt(2) could not be handled symbolically, it had to be represented numerically like 1.414.
Integration with a computer had to wait for symbolic manipulation software.

When you integrate with Maple, it is sometimes fun to get a glimpse of what it does. Try this:

> infolevel[int]:=5:

> int(sin(t^3),t);

int/indef1:   first-stage indefinite integration

int/indef2:   second-stage indefinite integration

int/trigon:   case of integrand containing trigs

int/prptrig:   case ratpoly*trig(arg)

int/rischnorm:   enter Risch-Norman integrator

int/rischnorm:   exit Risch-Norman integrator

int/risch:   enter Risch integration

int/risch/algebraic1:   RootOfs should be algebraic numbers and functions

int/risch:   the field extensions are

[t, exp(RootOf(_Z^2+1,index = 1)*t^3)]

int/risch:   Introduce the namings:

{_th[1] = exp(RootOf(_Z^2+1,index = 1)*t^3)}

int/risch/int:   integrand is

_th[1]-1/_th[1]

int/risch/exppoly:   integrating

_th[1]-1/_th[1]

int/risch/diffeq:   solving Risch d.e.  y' + f y = g  where f,g are:

3*RootOf(_Z^2+1,index = 1)*t^2, 1

int/risch/DEratpoly:   solving Risch d.e.  y' + f y = g  where f,g are:

3*RootOf(_Z^2+1,index = 1)*t^2, 1

int/risch/exppoly:   Risch d.e. has no solution

int/indef1:   first-stage indefinite integration

int/indef1:   first-stage indefinite integration

int/indef2:   second-stage indefinite integration

int/exp:   case of integrand containing exp

int/prpexp:   case ratpoly*exp(arg)

int/indef1:   first-stage indefinite integration

int/indef1:   first-stage indefinite integration

int/indef2:   second-stage indefinite integration

int/exp:   case of integrand containing exp

int/prpexp:   case ratpoly*exp(arg)

int/risch:   exit Risch integration

1/6*sqrt(Pi)*2^(1/3)*(3/4*t*2^(2/3)*sin(t^3)/(sqrt(...
1/6*sqrt(Pi)*2^(1/3)*(3/4*t*2^(2/3)*sin(t^3)/(sqrt(...

We then spent some time looking at substitution and integration by parts. It is important to understand that substitution is the "reverse chain rule" and integration by parts is the "reverse product rule".

> Int(x^3*cos(x^4),x);value(%);

Int(x^3*cos(x^4),x)

1/4*sin(x^4)

> Int(x^5*cos(x),x);value(%);sort(%);

Int(x^5*cos(x),x)

x^5*sin(x)+5*x^4*cos(x)-20*x^3*sin(x)-60*x^2*cos(x)...

x^5*sin(x)+5*x^4*cos(x)-20*x^3*sin(x)-60*x^2*cos(x)...

Do you see how the coefficients of the trig functions in the above example descend as derivatives? (The derivative of x^5 is 5*x^4 , etc). There is also a sign pattern that is ++ -- ++ -- etc.

With this observation you could probably easily write down the value of

> Int(x^3*sin(x),x);

Int(x^3*sin(x),x)

Try it.