Integration in Mathematica 13.1
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[]=
∫x
2x
Activate the inactive integral:
In[]:=
Activate∫x,Unevaluated[Integrate]
2x
Out[]=
2x
2
Change the variables:
In[]:=
IntegrateChangeVariables[Inactive[Integrate][Exp[2x],x],t,t==2x]
Out[]=
t
t
2
Activate the change:
In[]:=
Activatet,Unevaluated[Integrate]
t
2
Out[]=
t
2
Make the reverse replacement:
In[]:=
Activatet,Unevaluated[Integrate]/.{t->2x}
t
2
Out[]=
2x
2
Check the result:
In[]:=
∫Exp[2x]x
Out[]=
2x
2
Integrate with limits:
In[]:=
IntegrateChangeVariablesCos[x]Sin[x]x,t,t==Sin[x]
π
2
∫
0
Out[]=
1
∫
0
In[]:=
Activatett,Unevaluated[Integrate]
1
∫
0
Out[]=
1
2
Compute the integral directly:
In[]:=
π
2
∫
0
Out[]=
1
2
Integrate with multiple variables:
In[]:=
Inactive[Integrate]+,{w,0,1},x,0,
2
w
2
x
1-
2
w
Out[]=
1
∫
0
1-
2
w
∫
0
2
w
2
x
Activate the double integral:
In[]:=
Activate(+)xw,Unevaluated[Integrate]
1
∫
0
1-
2
w
∫
0
2
w
2
x
Out[]=
π
8
Use Integrate directly:
In[]:=
1
∫
0
1-
2
w
∫
0
2
w
2
x
Out[]=
π
8
Change coordinate systems from Cartesian to polar:
In[]:=
IntegrateChangeVariablesInactive[Integrate]+,{w,0,1},x,0,
2
w
2
x
1-
,{r,θ},"Cartesian"->"Polar"2
w
Out[]=
1
∫
0
π
2
∫
0
3
r
Activate:
In[]:=
Activateθr,Unevaluated[Integrate]
1
∫
0
π
2
∫
0
3
r
Out[]=
π
8
Change variables for a numerical integral:
In[]:=
IntegrateChangeVariablesNIntegrate+,{x,0,2},z,-
2
x
2
z
4-
,0,{r,θ},"Cartesian"->"Polar"2
x
Out[]=
NIntegrate,{r,0,2},θ,-,0
2
r
π
2
Activate the numerical integral:
In[]:=
ActivateNIntegrate,{r,0,2},θ,-,0,Unevaluated[NIntegrate]
2
r
π
2
Out[]=
4.18879
Check the result by comparing it to the direct output from NIntegrate:
In[]:=
NIntegrate+,{x,0,2},z,-
2
x
2
z
4-
,02
x
Out[]=
4.18879
Indefinite Integrals
Indefinite Integrals
Integrate an indefinite integral:
In[]:=
IntegrateChangeVariables∫Sin[3x]x,s,s==3x
Out[]=
s
Sin[s]
3
The last argument can be entered in terms of x instead of s:
In[]:=
IntegrateChangeVariablesInactive[Integrate][Sin[3x],x],s,x==
s
3
Out[]=
s
Sin[s]
3
Activate the integral:
In[]:=
Activates,Unevaluated[Integrate]
Sin[s]
3
Out[]=
-
Cos[s]
3
Make the reverse substitution:
In[]:=
Activates,Unevaluated[Integrate]/.{s->3x}//TraditionalForm
Sin[s]
3
Out[]//TraditionalForm=
-cos(3x)
1
3
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:
Definite Integrals:
Compute a definite integral:
Compute another definite integral:
Make an integral with emoji: