Lab 10: Integrals

0. Objective

In this lab we will learn how to integrate using Mathematica.  We will look at definite and indefinite integrals, graphs of antiderivatives and the relationship between functions and their integrals.

1. Narrative

First let’s look at how Mathematica does antiderivatives or indefinite integrals.  The Mathematica command for integration is Integrate.  For example,

∫sin(x)dx

is entered as

Integrate[Sin[x],x]

Notice that Mathematica did not put the “+C” at the end.  Mathematica gives an antiderivative, not the family of antiderivatives.

Task 1

Now you try some.  Open a new notebook and put your name and PIN at the top in a text field.  Then find the following antiderivatives using Mathematica.

(1) ∫(x^n)dx=

(2) ∫sec(x)dx=

(3) ∫((x^2)/(Sqrt[1-(x^2)]))dx=

(4) ∫(e^(-(x^2)))dx=

2. And Then There Were Definite Integrals

Here we will look at some definite integrals and the relationship between functions and their integrals.  First recall that a function need not be continuous in order for it’s antiderivative to exist. For example consider the functions,

f(x)=((|x|)/x),

g(x)=(∫_0^x)f(t)dt

Notice the results of the following.

f[x_]=Abs[x]/x;
g[x_]:=Integrate[f[t],{t,0,x},Assumptions->x∈Reals];
Plot[{f[x],g[x]},{x,-3,3},PlotStyle->{Blue,Red}]

The red curve is an antiderivative of the blue curve (recall the Fundamental Theorem of Calculus).  Also notice how the limits of integration are entered into the Integrate command.  Recall that the colon-equal ( := ) is the delayed assignment so the function g is just defined, but no simplification is performed until we actually use the function.  Lastly, the optional parameter ( Assumptions ) in the Integrate command let’s Mathematica know that we will use real numbers, rather than complex numbers, for x.

Task 2

Now you try some.  Continue in the notebook you used for the above task and work the following problems.

(5) Graph the following functions on the same axes where f(x)=|x|/x as above.  How does changing the lower limit in these integrals change the graph?

g2(x)=(∫_2^x)f(t)dt,	g3(x)=(∫_(-1)^x)f(t)dt,	g4(x)=(∫_(-2)^x)f(t)dt

(6)  Graph several antiderivatives of f(x)=(Sqrt[16-(x^2)]).  Note the domain of f should be used in the domain of the graphs.

(7) Use Mathematica to find the value (or an approximation of) the following integral.  Try using the Integrate[] (with and without the N[] commands) and then the NIntegrate[] command.  Comment on the results that you get.

(∫_0^1)tan((x^2))dx=