One of the main tools from calculus is the integral.
The definite integral is used to combine the values of a function over a region.
The indefinite integral is used to compute the function that gives you these integrated values.
And in Mathematica, you're not restricted to functions with a single input and output.
Integration can be used for functions in higher dimensions, too.
To compute an indefinite integral in Mathematica, use the Integrate function.
The first argument is the function,
and the second argument is the independent variable.
The Wolfram Language supports virtually any integral that is computable using existing mathematical functions.
Along the way,
you may come across functions which are not widely known.
But rest assured that the Mathematica help documentation is only a click away
to give you a detailed rundown of these functions.
When you compute the antiderivative,
you will notice that by default, the constant of integration is not included in the result.
If you would like a constant to be included,
use the GeneratedParameters option.
"C" is the typical value.
You can also include unknown parameters in your computation.
Constants and complex numbers are also allowed.
Even if you try to integrate an unknown function,
Mathematica will not raise an error.
Instead, it returns the unsimplified computation.
To compute definite integrals, you also use the Integrate function.
There is one difference, however.
The first argument is once again your function.
But the second argument is now a list containing the variable,
lower bound of integration, and upper bound of integration.
The Integrate function will return the exact value.
You can also integrate over the entire real number line by using -∞ and +∞ as bounds of integration.
As in mathematical writing, you write +∞ as simply ∞.
You can even compute the definite integral of a function with parameters.
When typing in integration commands,
you also have the ability to enter the command just as you would write it mathematically.
To see how, visit the menu..
click on "Palettes"..
and then select Basic Math Assistant.
The popup has a large collection of buttons and commands you can use with a single click.
Let's focus on the Typesetting options and click on the definite integral button.
The focus is already on the lower bound of integration.
Just type in your value, and then press TAB to enter the upper value.
Pressing TAB once more moves to the function slot.
Press TAB a final time to specify the variable
and then execute.
There is also a button for computing an indefinite integral.
For this, you only need to provide the function...
and variable...
If you prefer typing to clicking, you can mouse over these buttons to see the keyboard shortcut.
For an indefinite integral the shortcut is [escape] i-n-t-t [escape]
Then use TAB to jump between the parts of the integral.
For a definite integral, the keyboard shortcut is [escape] d-i-n-t-t [escape]
Using your keyboard arrows and tab
you can jump between the 4 parts of a definite integral.
By the way,
take a close look at the letter "d" for the "d-x".
The double stroke indicates this character has a special meaning.
The "d-x" is what's known as a differential.
Often times you want an approximate value to a definite integral,
rather than the exact mathematical expression.
You could always use the N function to approximate the value of an integral.
Or you could use the N-Integrate function.
The N-Integrate function is designed to quickly return a numerical approximation to the integral.
To see how much faster it is, let's use the Timing function.
To find the exact answer, Mathematica does require a measurable amount of time.
For the numerical approximation, however, the time required is negligible...
The Wolfram Language supports integration in any dimension.
To demonstrate this, let's look at some double integrals.
First, let's find the volume underneath this surface over a 10x10 square.
There isn't a different function for multiple integrals.
You just use Integrate with the function as your first argument,
and a list for each variable and the bounds of integration for that variable.
Like before, you can perform integrals with parameters...
You can also compute double integrals over the entire x-y plane.
Triple integrals and even higher order integrals are computed in a similar way.
Use Integrate with your function as the first argument,
and then a list for each variable with its bounds of integration.
There really is no limit to the number of variables you can have.
N-Integrate also supports higher dimensional integrals.
If you'd like to stay up-to-date about our upcoming Mathematica course,
why not join our mailing list?
It's free,
tastefully infrequent,
and a great way to spend the next 30 seconds.