Computational Essay
Sample Content
▼
Open Guidelines
Tools
Check
Publish to Cloud
Submit to Notebook Archive
Insert Code Group
Insert Headings▼
Insert Text▼
Open/Close Groups▼

Integration in Mathematica 13.1

PeterCullenBurbery
I work through how to integrate variables.
I've been learning how to use Inactive and Integrate with IntegrateChangeVariables. I think its cool to add a way to see what's going inside of Integrate with Inactive. The examples for this essay are from the documentation for IntegrateChangeVariables. I also changed some of the variable names so there is no a, e, i, o, or u because these are vowels. I also eliminated y.
Here are the possible variables I can use:
In[]:=
Alphabet[]
Out[]=
{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
Here are the ones I strive to use (the consonants):
In[]:=
DeleteCases[Alphabet[],Alternatives@@{"a","e","i","o","u","y"}]
Out[]=
{b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,z}
How many are there in total?
In[]:=
Length[DeleteCases[Alphabet[],Alternatives@@{"a","e","i","o","u","y"}]]
Out[]=
20
Twenty variables is plenty. There's no reason to use x all the time. I also don't like to use Greek letters.
Make an integral inactive:
In[]:=
Inactive[Integrate][Exp[2x],x]
Out[]=
∫
2x

x
Activate the inactive integral:
In[]:=
Activate∫
2x

x,Unevaluated[Integrate]
Out[]=
2x

2
Change the variables:
In[]:=
IntegrateChangeVariables[Inactive[Integrate][Exp[2x],x],t,t==2x]
Out[]=

t

2
t
Activate the change:
In[]:=
Activate
t

2
t,Unevaluated[Integrate]
Out[]=
t

2
Make the reverse replacement:
In[]:=
Activate
t

2
t,Unevaluated[Integrate]/.{t->2x}
Out[]=
2x

2
Check the result:
In[]:=
∫Exp[2x]x
Out[]=
2x

2
Integrate with limits:
In[]:=
IntegrateChangeVariables
π
2
∫
0
Cos[x]Sin[x]x,t,t==Sin[x]
Out[]=
1
∫
0
tt
In[]:=
Activate
1
∫
0
tt,Unevaluated[Integrate]
Out[]=
1
2
Compute the integral directly:
In[]:=
π
2
∫
0
Sin[x]Cos[x]x
Out[]=
1
2
Integrate with multiple variables:
In[]:=
Inactive[Integrate]
2
w
+
2
x
,{w,0,1},x,0,
1-
2
w

Out[]=
1
∫
0
1-
2
w
∫
0
(
2
w
+
2
x
)xw
Activate the double integral:
In[]:=
Activate
1
∫
0
1-
2
w
∫
0
(
2
w
+
2
x
)xw,Unevaluated[Integrate]
Out[]=
π
8
Use Integrate directly:
In[]:=
1
∫
0
1-
2
w
∫
0
(
2
w
+
2
x
)xw
Out[]=
π
8
Change coordinate systems from Cartesian to polar:
In[]:=
IntegrateChangeVariablesInactive[Integrate]
2
w
+
2
x
,{w,0,1},x,0,
1-
2
w
,{r,θ},"Cartesian"->"Polar"
Out[]=
1
∫
0
π
2
∫
0
3
r
θr
Activate:
In[]:=
Activate
1
∫
0
π
2
∫
0
3
r
θr,Unevaluated[Integrate]
Out[]=
π
8
Change variables for a numerical integral:
In[]:=
IntegrateChangeVariablesNIntegrate
2
x
+
2
z
,{x,0,2},z,-
4-
2
x
,0,{r,θ},"Cartesian"->"Polar"
Out[]=
NIntegrate
2
r
,{r,0,2},θ,-
π
2
,0
Activate the numerical integral:
In[]:=
ActivateNIntegrate
2
r
,{r,0,2},θ,-
π
2
,0,Unevaluated[NIntegrate]
Out[]=
4.18879
Check the result by comparing it to the direct output from NIntegrate:
In[]:=
NIntegrate
2
x
+
2
z
,{x,0,2},z,-
4-
2
x
,0
Out[]=
4.18879

Indefinite Integrals

Integrate an indefinite integral:
In[]:=
IntegrateChangeVariables∫Sin[3x]x,s,s==3x
Out[]=

Sin[s]
3
s
The last argument can be entered in terms of x instead of s:
In[]:=
IntegrateChangeVariablesInactive[Integrate][Sin[3x],x],s,x==
s
3

Out[]=

Sin[s]
3
s
Activate the integral:
In[]:=
Activate
Sin[s]
3
s,Unevaluated[Integrate]
Out[]=
-
Cos[s]
3
Make the reverse substitution:
In[]:=
Activate
Sin[s]
3
s,Unevaluated[Integrate]/.{s->3x}//TraditionalForm
Out[]//TraditionalForm=
-
1
3
cos(3x)
Verify the result:
Integrate log 2x:
Activate the new integral:
Switch back to x from t:
Simplify the expression:
Verify the integral is correct:
Use the function to integrate the natural logarithm:
Add assumptions to simplify the output:
Verify the solution:
Integrate two integrals:
Activate the substitution:
Verify:
Integrate by changing coordinate systems:

Definite Integrals:

Compute a definite integral:
Compute another definite integral:
Make an integral with emoji: