Integrate 
Details and Options
- Integrate[f,x] can be entered as ∫fx.
- ∫ can be entered as
int
or \[Integral]. - is not an ordinary d; it is entered as
dd
or \[DifferentialD]. - Integrate[f,{x,y,…}∈reg] can be entered as ∫{x,y,…}∈regf.
- Integrate[f,{x,xmin,xmax}] can be entered with xmin as a subscript and xmax as a superscript to ∫.
- Multiple integrals use a variant of the standard iterator notation. The first variable given corresponds to the outermost integral and is done last. »
- Integrate can evaluate integrals of rational functions. It can also evaluate integrals that involve exponential, logarithmic, trigonometric, and inverse trigonometric functions, so long as the result comes out in terms of the same set of functions.
- Integrate can give results in terms of many special functions.
- Integrate carries out some simplifications on integrals it cannot explicitly do.
- You can get a numerical result by applying N to a definite integral. »
- You can assign values to patterns involving Integrate to give results for new classes of integrals.
- The integration variable can be a construct such as x[i] or any expression whose head is not a mathematical function.
- For indefinite integrals, Integrate tries to find results that are correct for almost all values of parameters.
- For definite integrals, the following options can be given:
-
Assumptions $Assumptions assumptions to make about parameters GenerateConditions Automatic whether to generate answers that involve conditions on parameters GeneratedParameters None how to name generated parameters PrincipalValue False whether to find Cauchy principal values - Integrate can evaluate essentially all indefinite integrals and most definite integrals listed in standard books of tables.
- In StandardForm, Integrate[f,x] is output as ∫fx.
Examples
open all close allBasic Examples (4)
Integrate[x ^ 2 + Sin[x], x]Integrate[1 / (x ^ 3 + 1), {x, 0, 1}]Visualize the area given by this integral:
Plot[(1/x^3 + 1), {x, 0, 1}, Filling -> Axis]Use
int
to enter ∫ and
dd
to enter :
∫Sqrt[x + Sqrt[x]]ⅆxTraditionalForm[%]Use
to enter the lower limit, then
for the upper limit:
Subsuperscript[∫, 0, ∞]Log[x] Exp[-x^2]ⅆxScope (78)
Basic Uses (13)
Compute an indefinite integral:
int = Integrate[1 / (x ^ 3 + 1), x]Verify the answer by differentiation:
D[int, x]//SimplifyUse
intt
to enter a template
and
to move between fields:
∫(a x ^ 2 + b x + c)ⅆxInclude the constant of integration in an indefinite integral:
Integrate[x ^ 2, x, GeneratedParameters -> C]Compute a definite integral over a finite interval:
Integrate[(2x + 3) / (x ^ 2 + 5x + 6), {x, 0, 2}]Integrate[BesselJ[2, x] / (1 + x ^ 2), {x, 0, ∞}]Integrate[Sin[x] / x, {x, -∞, ∞}]Use
dintt
to enter a template
and
to move between fields:
Subsuperscript[∫, 0, π]Cos[x]ⅆxIntegrate a function with a symbolic parameter:
Integrate[(a x/x^3 + 2), {x, 1, ∞}]An integral that only converges for some values of parameters:
Integrate[Exp[-c x^2], {x, -∞, ∞}]Specify alternate assumptions to use:
Integrate[Exp[-c x^2], {x, -∞, ∞}, Assumptions -> Re[c] == 0]Integrate[(BesselJ[3, y]/x + 1), {x, 0, 5}, {y, 0, 5}]Integrate[Exp[-x + y], {x, 0, ∞}, {y, 0, 1}]Multiple integral with x integration last:
Integrate[Sin[x y], {x, 0, 1}, {y, 0, x}]In StandardForm, the differential y precedes x:
Subsuperscript[∫, 0, 1]Subsuperscript[∫, 0, x]Sin[x y]ⅆyⅆxVisualize the function over the domain of integration:
Plot3D[Sin[x y], {x, y}∈Triangle[{{0, 0}, {0, 1}, {1, 0}}]]Integrals over standard regions:
Integrate[1, {x, y}∈Circle[]]The character ∈ can be entered as
el
or \[Element]:
Integrate[1, x∈Ball[3]]Enter a region specification
in an underscript using
:
Underscript[∫, {x, y, z}∈Tetrahedron[]](x^4 y^5 + z^10)Use
rintt
to enter a template
and
to move between fields:
Underscript[∫, {x, y}∈Rectangle[]]x y^2Integrate[f'[x], x]Integrate[((1 - f[x])f'[x]) / E ^ f[x], x]Integrals of vector- and array-valued functions:
Integrate[{x, (1/Sqrt[x]), Sin[x]}, {x, 0, 5}]Integrate[(| | | |
| ------- | ------- | ------- |
| x | Sqrt[x] | x^1 / 3 |
| Sqrt[x] | x^1 / 3 | x^1 / 4 |
| x^1 / 3 | x^1 / 4 | x^1 / 5 |), {x, 0, 5}]//MatrixFormInvoke NIntegrate automatically if symbolic integration fails:
Integrate[E ^ (-x ^ x), {x, 0, 1}]N[%]Indefinite Integrals (10)
∫x^nⅆx∫(1/x)ⅆx∫Sin[x]ⅆx∫Exp[x]ⅆxGenerate an answer with a constant of integration:
Integrate[Exp[x], x, GeneratedParameters -> C]Integrals of trigonometric functions:
∫Sec[x]^2ⅆx∫Cot[x]ⅆx∫Sec[x]ⅆxVerify the previous answer via differentiation:
D[%, x]//SimplifyCreate a nicely formatted table of integrals:
flist = {x ^ n, 1 / x, b^x, Log[x], Sin[x], Cos[x], (1/x^2 + a^2), (1/x^2 - a^2)};Grid[Prepend[Transpose[{flist, Integrate[flist, x]}], {f[x], ∫f[x]ⅆx}], IconizedObject[«Grid options»]]//TraditionalFormRational functions can always be integrated in closed form:
Integrate[1 / (x ^ 4 - 1), x]Integrate[( x + 1/a^2 x^2 + c^2), x]Sometimes they involve sums of Root objects:
Integrate[1 / (x ^ 5 + 2x + 1), x]Integrals of general elementary functions:
∫ArcSin[x]ⅆx∫Cosh[x]ⅆx∫(x^2/Sqrt[a^2 + x^2])ⅆx∫Exp[a x]Cos[b x]ⅆxIntegrate returns antiderivatives valid in the complex plane where applicable:
intℂ[x_] = ∫Tan[x]ⅆxD[intℂ[x], x]A common antiderivative found in integral tables for
is
:
intℝ[x_] = Log[RealAbs[Sec[x]]];This is a valid antiderivative for real values of
:
Simplify[D[intℝ[x], x]]On the real line, the two integrals have the same real part:
FullSimplify[Re[intℂ[x]] == Re[intℝ[x]]]Plot[{Re[intℂ[x]], Re[intℝ[x]]}, {x, 0, 4Pi}, PlotTheme -> {"Detailed", "NeonColors", "DashedLines"}]But the imaginary parts differ by
on any interval where
is negative:
Plot[{Im[intℂ[x]], Im[intℝ[x]], Cos[x]}, {x, 0, 4Pi}, PlotTheme -> {"Detailed", "NeonColors", "DashedLines"}]Similar integrals can lead to functions of different kinds:
Integrate[Sqrt[x]Sqrt[1 + x], x]Integrate[Sqrt[x]Sqrt[1 + x]Sqrt[2 + x], x]Many integrals can be done only in terms of special functions such as Erf:
Integrate[Exp[-x ^ 2], x]Generalizations of Log such as PolyLog and LogIntegral:
Integrate[Log[1 + x] ^ 2 / x, x]Integrate[Log[Log[x]], x]Hypergeometric functions such as Hypergeometric2F1:
Integrate[Tan[x] ^ n, x]Create a nicely-formatted table of special function integrals:
flist = {BesselJ[0, x], Erf[x], EllipticE[x], Sqrt[x]PolyLog[2, x], AiryAi[x], SinhIntegral[2 / (x + 1)]};Grid[Prepend[Transpose[{flist, Integrate[flist, x]}], {f[x], ∫f[x]ⅆx}], IconizedObject[«Grid options»]]//TraditionalFormThe variable of integration need not be a single symbol:
Integrate[p[x]Log[p[x]], p[x]]Definite Integrals (13)
Integrate[x ^ 4 + x ^ 2 + 1, {x, 1, 3}]Visualize the area under the curve:
Plot[x ^ 4 + x ^ 2 + 1, {x, 1, 3}, Filling -> Axis]Integrate a symbolic polynomial:
Integrate[a x ^ 2 + b x + c, {x, -2, 2}]Integrate over a symbolic range:
Integrate[x ^ n + n x, {x, 0, a}, Assumptions -> n > 1 && n∈ℤ]Integrate[1 / (x ^ 4 + x ^ 2 + 1), {x, 0, Infinity}]Plot[(1/x^4 + x^2 + 1), {x, 0, 5}, Filling -> Axis, PlotRange -> All, Epilog -> {RGBColor[0.368417, 0.506779, 0.709798], Arrow[{{0, 0}, {5, 0}}]}]Integrate[(4x ^ 2 - 7x - 12) / ((x + 2)(x - 3)), {x, -1, 2}]Plot[(4 x^2 - 7 x - 12/(x + 2) (x - 3)), {x, -1, 2}, Filling -> 0, PlotRange -> All]Integrate[(1 + x^3) CubeRoot[x], {x, -1, 1}]Plot[(1 + x^3) CubeRoot[x], {x, -1, 1}, Filling -> Axis, FillingStyle -> {RGBColor[0.95, 0.627, 0.1425, 0.2], RGBColor[0.24, 0.6, 0.8, 0.2]}]Integrate[1 / ((2 + x ^ 2)Sqrt[4 + 3x ^ 2]), {x, -∞, ∞}]Plot[(1/(2 + x^2) Sqrt[4 + 3 x^2]), {x, -7, 7}, Filling -> 0, AxesOrigin -> {0, 0}, Epilog -> {RGBColor[0.368417, 0.506779, 0.709798], Arrowheads[{-Medium, Medium}], Arrow[{{-7, 0}, {7, 0}}]}]Integrate[Cos[2x] ^ 4, {x, 0, π}]Plot[Cos[2x] ^ 4, {x, 0, π / 2}, Filling -> Axis]Integrate[x ^ 2Sin[2x], {x, 0, 2π}]Plot[x ^ 2Sin[2x], {x, 0, 2π}, Filling -> Axis, FillingStyle -> {RGBColor[0.95, 0.627, 0.1425, 0.2], RGBColor[0.24, 0.6, 0.8, 0.2]}]Exponential and logarithmic functions:
Integrate[x ^ 5Log[x], {x, 1, 2}]Plot[x ^ 5Log[x], {x, 1, 2}, Filling -> Axis]Integrate[Exp[-x + Exp[-x]], {x, 0, ∞}]Plot[Exp[-x + Exp[-x]], {x, 0, 4}, PlotRange -> Full, Filling -> Axis, Epilog -> {RGBColor[0.368417, 0.506779, 0.709798], Arrowheads[Medium], Arrow[{{0, 0}, {4, 0}}]}]Hyperbolic trigonometric functions:
Integrate[x Cosh[x], {x, 0, a}]Integrate[x^2 Sech[x]^2, {x, -∞, ∞}]Integrate a function with a vertical asymptote:
Integrate[x / Sqrt[1 - x], {x, 0, 1}]Plot[x / Sqrt[1 - x], {x, 0, 1}, Filling -> Axis]This can be viewed as a limit of the result of integration on a smaller interval:
Underscript[, a -> 1^ - ]Subsuperscript[∫, 0, a](x/Sqrt[1 - x])ⅆxCompute the integral of a function with two vertical asymptotes:
area = Subsuperscript[∫, -1, 1](x^2/Sqrt[1 - x^4])ⅆx%//NPlot[(x^2/Sqrt[1 - x^4]), {x, -1, 1}, Filling -> 0]This can be viewed as a multivariate limit of the result of integration on a smaller interval:
area == Limit[Integrate[(x^2/Sqrt[1 - x^4]), {x, a, b}, Assumptions -> -1 < a < b < 1], {a, b} -> {-1, 1}, Direction -> {"FromAbove", "FromBelow"}]Integrals over infinite intervals can be viewed as limits of integrals over finite domains:
Integrate[x E ^ (-x), {x, 1, ∞}]The preceding is the limit as
of the integral from
to
:
% == Underscript[, a -> ∞]Integrate[x E ^ (-x), {x, 1, a}]Subsuperscript[∫, -∞, ∞]E^-x^2ⅆxIt is the bivariate limit of a finite integral:
% == Underscript[, {a, b} -> {-∞, ∞}]Subsuperscript[∫, a, b]E^-x^2ⅆxWhen there are parameters, conditions that ensure convergence may be reported:
Integrate[x ^ n, {x, 0, 1}]Integrate[E ^ (a x), {x, 0, ∞}]Integrals of elementary functions may produce special function answers:
Integrate[Sin[t] / t, {t, a, b}]Integrate[Cos[Sin[x] ^ 2], {x, 0, 2π}]%//NPlot[Cos[Sin[x] ^ 2], {x, 0, 2π}, Filling -> 0, PlotRange -> {0, 1}]Create a formatted table of definite integrals over the positive reals of special functions:
flist = {BesselJ[2, x] / x, BesselK[0, x] ^ 2, AiryAi[x] ^ 2, Exp[-x] Sinc[x], Sin[x]Erfc[x]};Grid[Prepend[Transpose[{flist, Subsuperscript[∫, 0, ∞]flistⅆx}], {f[x], Subsuperscript[∫, 0, ∞]f[x]ⅆx}], IconizedObject[«Grid options»]]//TraditionalFormIntegral along a complex line:
Integrate[Sqrt[x], {x, I, 3 - I}]Integrate along a piecewise linear contour in the complex plane:
Integrate[(1/z + 1 / 2), {z, 1, E^(I π/3), E^(2 I π/3), -1, E^-(2 I π/3), E^-(I π/3), 1}]//FullSimplifyIntegrate the same function along a circular contour:
Integrate[(I Exp[I ω]/Exp[I ω] + 1 / 2), {ω, 0, 2π}]Plot the function and paths of integration:
ComplexPlot[(1/z + 1 / 2), {z, -1.2 - 1.2I, 1.2 + 1.2I}, Epilog -> {Thick, Arrowheads[Medium], White, Arrow[{{1, -.05}, {1, 0}}], Circle[], Dashed, Black, Arrow[ReIm /@ Exp[2π I / 6 Range[0, 6]]]}]Integrals of Piecewise and Generalized Functions (12)
Compute the indefinite integral of a Piecewise function:
f[x_] := Piecewise[{{-x^2, x < 0}, {x^2, True}}]∫f[x]ⅆxIn this case, the derivative of the integral equals the original function:
Simplify[D[%, x] == f[x]]Integrate a discontinuous Piecewise function:
f[x_] := Piecewise[{{-x + 1, x < 0}, {x, 0 < x < 1}, {x^2, True}}]g[x_] = ∫f[x]ⅆxExcept at the point of discontinuity, the derivative of g equals f:
Resolve[ForAll[x, x != 0 && x∈ℝ, Derivative[1][g][x] == f[x]]]Visualize the function and its antiderivative:
Plot[{f[x], g[x]}, {x, -2, 2}, PlotTheme -> {"Detailed", "DashedLines"}]Integrate functions that are piecewise-defined:
unitInt[x_] = Integrate[x UnitStep[x], x]Plot[{x UnitStep[x], unitInt[x]}, {x, -2, 2}, PlotTheme -> {"Detailed", "DashedLines"}]clipInt[x_] = Integrate[Clip[x] ^ 2, x]Plot[{Clip[x] ^ 2, clipInt[x]}, {x, -2, 2}, PlotTheme -> {"Detailed", "DashedLines"}]Integrate a piecewise function with infinitely many cases:
maxInt[x_] = Integrate[Max[Sin[x], Cos[x]], x]Everywhere it is defined, the derivative of maxInt equals the original function:
Simplify[D[maxInt[x], x] == Max[Sin[x], Cos[x]]]However, maxInt itself is discontinuous:
Plot[{Max[Sin[x], Cos[x]], maxInt[x]}, {x, 0, 4Pi}, PlotTheme -> {"Detailed", "DashedLines"}]Compute a definite integral of a Piecewise function:
f[x_] := Piecewise[{{1, x < 2}, {x^3, 2 < x < 3}}, 0]Integrate[f[x], {x, 0, 3}]Compute the integral with a variable endpoint:
int[x_] = Integrate[f[t], {t, 0, x}, Assumptions -> x > 0]Visualize the function and its integral:
Plot[{f[x], int[x]}, {x, 0, 4}, PlotTheme -> {"Detailed", "DashedLines"}]Compute definite integrals of piecewise functions such as Floor:
Integrate[Floor[x ^ 2], {x, 0, 3}]Plot[Floor[x ^ 2], {x, 0, 3}, Filling -> Axis]Integrate[PrimePi[n], {n, 0, 100}]Plot[PrimePi[x], {x, 0, 100}, Filling -> Axis]A composition of piecewise functions:
Integrate[Ceiling[x ^ 2 + TriangleWave[x]], {x, -2, 2} ]Compute the definite integral with a variable upper limit:
f[x_] := x ^ 2 UnitStep[x + 1]int[a_] = Integrate[f[x], {x, -3, a}]Plot[{f[a], int[a]}, {a, -2, 2}, PlotTheme -> {"Detailed", "DashedLines"}]A function with an infinite number of cases:
f[x_] := Max[Sin[x], Cos[x]]f[x]//PiecewiseExpandIntegrate over a finite number of cases using Assumptions:
maxInt[a_] = Integrate[f[x], {x, 0, a}, Assumptions -> 0 < a < 2Pi]The integral is a continuous function of the upper limit over the domain of integration:
Plot[{f[a], maxInt[a]}, {a, 0, 2Pi}, PlotTheme -> {"Detailed", "DashedLines"}]Integrate generalized functions:
Integrate[DiracDelta[x], {x, -∞, ∞}]Integrate[Sin[x] ^ 2 HeavisideTheta[x + π]HeavisideTheta[π - x], {x, -∞, ∞}]Integrate[DiracDelta[Cos[x ^ 2 - 1]], {x, -2, 2}]Indefinite integrals of generalized functions return generalized functions:
Integrate[DiracDelta[x], x]Integrate[DiracDelta[x], x, x]Integrate generalized functions over subsets of the reals:
Integrate[f[x] DiracDelta[x - a], {x, -1, 1}, Assumptions -> a∈Reals]Integrate[Cos[x - a] HeavisideLambda[x], {x, 0, Pi}, Assumptions -> a∈Reals]Integrate an interpolating function:
f = Interpolation[{10, -5, 10, -10, 20}]g = Head[Integrate[f[x], x]]Test that g is a correct antiderivative at x==3.5:
g'[3.5] == f[3.5]Visualize the function and its antiderivative:
Plot[{f[x], g[x]}, {x, 1, 5}, PlotTheme -> {"Detailed", "DashedLines"}]Nested Integrals (12)
Compute a second antiderivative of a function:
Integrate[a x ^ 2 + b x + c, x, x]//ExpandD[%, {x, 2}]Compute the third antiderivative:
∫∫∫(1/x^2 + 4)ⅆxⅆxⅆxFullSimplify[D[%, {x, 3}]]Integrate a function with respect to two different variables:
Integrate[x ^ 2Sin[y], y, x]The mixed partial derivative gives the original function:
D[%, x, y]Generate a constant of integration for a single integral:
Integrate[x, x, GeneratedParameters -> C]Generate constants for a nested integral with respect to the same variable:
Integrate[x, x, x, GeneratedParameters -> C]This is the most general second antiderivative of the integrand:
D[%, x, x]Generate two functions of integration for a nested integral with respect to two variables:
Integrate[x, x, y, GeneratedParameters -> C]This is the most general mixed antiderivative of the integrand:
D[%, x, y]Integrate over the rectangle from
to
:
Integrate[Exp[x]Cos[y], {x, 0, a}, {y, 0, b}]Subsuperscript[∫, 0, a]Subsuperscript[∫, 0, b]Exp[x]Cos[y]ⅆyⅆxIntegrate in the opposite order:
Subsuperscript[∫, 0, b]Subsuperscript[∫, 0, a]Exp[x]Cos[y]ⅆxⅆyCombine indefinite and definite integration:
Integrate[(x + y), {y, 0, 1}, x]Compute a rational double integral over a rectangular region:
Integrate[x ^ 2y / (x + y), {x, 0, 3}, {y, 1, 2}]This gives the volume of the shaded region:
Plot3D[(x^2 y/x + y), {x, 0, 3}, {y, 1, 2}, Filling -> Axis, FillingStyle -> Opacity[0.6], Mesh -> None]Compute a trigonometric double integral over a rectangular region:
Integrate[y Sin[x y], {x, 1, 4}, {y, 0, π}]There is as much positive volume (dark gray) as negative (light blue):
Plot3D[{y Sin[x y], 0}, {x, 1, 4}, {y, 0, π}, IconizedObject[«Plot3D options»]]Compute a polynomial double integral over the area between two curves:
Subsuperscript[∫, -2, 2]Subsuperscript[∫, 2 x^2, 4 + x^2](8 - (3 y/3) - (3 x y/3) + (x^2 y/3) + (x^3 y/3))ⅆyⅆxVisualize the domain of integration and the volume corresponding to the integral:
Plot[{2x ^ 2, 4 + x ^ 2}, {x, -2, 2}, Filling -> {1 -> {2}}, PlotLegends -> "Expressions"]Plot3D[8 - (3 y/3) - (3 x y/3) + (x^2 y/3) + (x^3 y/3), {x, y}∈ImplicitRegion[-2 < x < 2 && 2 x^2 < y < 4 + x^2, {x, y}], FillingStyle -> Opacity[.5], Filling -> Axis, PlotRange -> All, ViewPoint -> {.3, 3.1, 1.3}, Mesh -> None]Compute a triple integral over a rectangular prism:
Integrate[Cos[z]Exp[x]y, {x, 0, 1}, {y, -1, 2}, {z, 0, 3}]Visualize the region of integration:
RegionPlot3D[0 < x < 1 && -1 < y < 2 && 0 < z < 3, {x, -0.5, 1.5}, {y, -1.5, 2.5}, {z, -0.5, 3.5}]Compute an algebraic triple integral over a cone-shaped 3D region:
Integrate[Sqrt[x ^ 2 + z ^ 2]y, {x, -2, 2}, {y, x ^ 2, 4}, {z, -Sqrt[y - x ^ 2], Sqrt[y - x ^ 2]}]//FullSimplifyVisualize the region of integration:
RegionPlot3D[y > x ^ 2 + z ^ 2 && 0 < y < 4, {x, -3, 3}, {y, -0.5, 4.5}, {z, -3, 3}]Integrate a multivariate function over a five-dimensional cube:
Integrate[a b ^ 2 - c / d ^ e, {a, 0, 1}, {b, 1, 2}, {c, 2, 3}, {d, 3, 4}, {e, 4, 5}]N[%]Integrate
over the unit ball in 4 dimensions:
f[r_, θ_] := (Sin[θ]/r)Look up the coordinate ranges for hyperspherical coordinates in CoordinateChartData:
CoordinateChartData["Hyperspherical", "CoordinateRangeAssumptions", {r, θ, φ, ψ}]Also look up the volume factor:
CoordinateChartData["Hyperspherical", "VolumeFactor", {r, θ, φ, ψ}]Subsuperscript[∫, -π, π]Subsuperscript[∫, 0, π]Subsuperscript[∫, 0, π]Subsuperscript[∫, 0, R]f[r, θ](r^3 Sin[θ]^2 Sin[φ])ⅆrⅆθⅆφⅆψRegion Integrals (11)
Integrate a constant over a unit disk:
Integrate[1, {x, y}∈Disk[]]Enter the integral in typeset form:
Underscript[∫, {x, y}∈Disk[]]1Equivalently, integrate over a rectangular region and restrict to a disk using Boole:
Integrate[Boole[x ^ 2 + y ^ 2 ≤ 1], {x, -1, 1}, {y, -1, 1}]Subscript[∫, {x, y}∈Disk[]](Cos[3x]Sin[5y] + x^2)The same integral expressed using Boole:
Subsuperscript[∫, -1, 1]Subsuperscript[∫, -1, 1](Cos[3x]Sin[5y] + x^2)Boole[x^2 + y^2 ≤ 1]ⅆyⅆxThe same integral reduced to an iterated integral with bounds depending on the previous variables:
Subsuperscript[∫, -1, 1]Subsuperscript[∫, -Sqrt[1 - x^2], Sqrt[1 - x^2]](Cos[3x]Sin[5y] + x^2)ⅆyⅆxPlot the integrand over the integration region:
Plot3D[Cos[3x]^2Sin[5y] + 1, {x, y}∈Disk[], Filling -> 0, Mesh -> None, FillingStyle -> Automatic]Express a normal definite integral using region notation:
Integrate[Sin[b x], {x}∈Interval[{0, Pi}]]Compare with the list notation:
Integrate[Sin[b x], {x, 0, Pi}]With GenerateConditions True, assumptions are generated so that the region is non-degenerate:
Integrate[x^2y, {x, y}∈Rectangle[{0, 0}, {a, b}], GenerateConditions -> True]Compare with an iterated integral:
Integrate[x^2y, {x, 0, a}, {y, 0, b}, GenerateConditions -> True]Integrate over the unit circle:
Subscript[∫, {x, y}∈Circle[]](x^2 y + y^2/2)Express the same integral as a one-dimensional integral using polar coordinates:
Subsuperscript[∫, -Pi, Pi](Cos[θ]^2Sin[θ] + Sin[θ]^2/2)ⅆθIntegrate over a sphere of radius
:
Underscript[∫, {x, y, z}∈Sphere[{x0, y0, z0}, r]](1/(x - x0)^2 + (y - y0)^2 + (z - z0)^2)Integrate over a finite set of points:
Integrate[1, {x, y, z}∈Point[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]]Regions can be given as logical combinations of inequalities:
int1 = Integrate[Boole[1 < x ^ 2 - y ^ 2 < 4 && x y < 1 && x > 0 && y > 0], {x, -∞, ∞}, {y, -∞, ∞} ]Define the region as an ImplicitRegion and integrate directly over the region:
reg = ImplicitRegion[1 < x ^ 2 - y ^ 2 < 4 && x y < 1 && x > 0 && y > 0, {x, y}];int2 = Integrate[1, {x, y}∈reg]FullSimplify[int1 - int2]Visualize the domain of integration:
RegionPlot[reg]Integral over a three-dimensional region defined by inequalities:
reg = ImplicitRegion[x + 2y + 3z < 2 && -1 < x < y < z < 1, {x, y, z}];Subscript[∫, {x, y, z}∈reg](x^2 + 2y z)Visualize 3D regions using RegionPlot3D:
RegionPlot3D[reg, PlotPoints -> 65, PlotTheme -> "FrameGrid"]Integrate[ (x ^ 2 + y ^ 2) Boole[0 ≤ z ≤ 1 && x ^ 2 + y ^ 2 ≤ z ^ 2], {x, -∞, ∞}, {y, -∞, ∞}, {z, -∞, ∞} ]Visualize the domain of integration:
RegionPlot3D[0 ≤ z ≤ 1 && x ^ 2 + y ^ 2 ≤ z ^ 2, {x, -1, 1}, {y, -1, 1}, {z, 0, 1}]Integrate a function with parameters, getting a piecewise result:
Integrate[Boole[ax < y], {x, 0, 1}, {y, 0, 1}]A region with infinitely many components:
reg = ImplicitRegion[Sin[x] > 1 / 2, {{x, 0, ∞}}];Underscript[∫, {x}∈reg]Exp[-x]Symbolic Features of Integrals (7)
Integrals involving unknown functions are done when possible:
Integrate[f''[x] + 2 a f'[x], x]Differentiate with respect to an endpoint, yielding the fundamental theorem of calculus:
Integrate[f[t], {t, 0, x}]D[%, x]Subscript[∂, x]Subsuperscript[∫, a[x], b[x]]f[t]ⅆtSymbolic integrals can be differentiated with respect to parameters:
Integrate[f[x, a], {x, 0, 1}]D[%, a]Differentiate with respect to a parameter that appears in both integrand and endpoints:
Subscript[∂, a]Subsuperscript[∫, p[a], q[a]]f[x, a]ⅆxUse the Inactive form of Integrate:
Inactive[Integrate][1 / (1 + x), x]D[%, x]Illustrate indefinite integral identities:
Inactivate[∫x^nⅆx, Integrate] == ∫x^nⅆxInactivate[∫(1/Sqrt[1 - x^2])ⅆx, Integrate] == ∫(1/Sqrt[1 - x^2])ⅆxVerify the identities starting from the inactive forms:
Activate[{Inactive[Integrate][x^n, x] == (x^1 + n/1 + n), Inactive[Integrate][1/Sqrt[1 - x^2], x] == ArcSin[x]}]Illustrate the basic commutation trick for differentiating under the integral sign:
Inactivate[Integrate[D[f[x, a], a], x] == ((D[Integrate[f[x, a], x], a]))]Activate[Inactive[Integrate][Inactive[D][Inactive[f][x, a], a], x] == Inactive[D][Inactive[Integrate][Inactive[f][x, a], x], a]]Compute the LaplaceTransform of an integral:
LaplaceTransform[Integrate[f[u], {u, 0, t}], t, s]Options (11)
Assumptions (3)
By default, conditions are generated on parameters that guarantee convergence:
Integrate[x ^ n, {x, 0, 1}]With Assumptions, a result valid under the given assumptions is given:
Integrate[x ^ n, {x, 0, 1}, Assumptions -> n > 0]Manually specify Assumptions to test values outside the automatically generated conditions:
Integrate[Exp[-a x^2], {x, -∞, ∞}]This integral is also convergent for purely imaginary
:
Integrate[Exp[-a x^2], {x, -∞, ∞}, Assumptions -> Re[a] == 0]Specify assumptions to evaluate a piecewise indefinite integral:
Integrate[Floor[x], x]Integrate[Floor[x], x, Assumptions -> 0 < x < 5]GenerateConditions (2)
By default, univariate definite integrals generate conditions on parameters that ensure convergence:
Integrate[Exp[-a x ^ 2], {x, 0, ∞}]Generate a result without conditions:
Integrate[Exp[-a x ^ 2], {x, 0, ∞}, GenerateConditions -> False]Use GenerateConditions->False to speed up integration:
Integrate[x ^ n, {x, -1, b}, GenerateConditions -> False]//TimingIntegrate[ x ^ n, {x, -1, b}, GenerateConditions -> True]//TimingGeneratedParameters (4)
By default a particular antiderivative is returned:
Integrate[x, x]Specify a value of GeneratedParameters to obtain the general antiderivative:
Integrate[x, x, GeneratedParameters -> C]One parameter is generated for each indefinite integral:
Integrate[Exp[2x], x, x, GeneratedParameters -> C]Integrate[Exp[2x], x, x, x, GeneratedParameters -> C]If the input expression already contains a generated parameter, the next available index will be used:
Integrate[(E^2 x/8) + C[3], x, GeneratedParameters -> C]For nested integrals with multiple variables, the antiderivative contains arbitrary functions:
Integrate[Exp[2x], x, y, GeneratedParameters -> C]Integrate[Exp[2x], x, y, z, GeneratedParameters -> C]This is the most general antiderivative of the integrand:
D[%, x, y, z]The value of GeneratedParameters is applied to the index of each generated parameter:
Integrate[Cos[x], x, x, GeneratedParameters -> f]The value can be a pure function:
Integrate[Cos[x], x, x, GeneratedParameters -> (Subscript["const", #]&)]A value of None disables generated parameters:
Integrate[Cos[x], x, x, GeneratedParameters -> None]PrincipalValue (2)
The ordinary Riemann definite integral is divergent:
Integrate[1 / x, {x, -1, 2}]The Cauchy principal value integral is finite:
Integrate[1 / x, {x, -1, 2}, PrincipalValue -> True]The value is the limit of removing a symmetric region about the singularity:
Underscript[, a -> 0^ + ](Subsuperscript[∫, -1, -a](1/x)ⅆx + Subsuperscript[∫, a, 2](1/x)ⅆx)The ordinary Riemann definite integral is divergent:
Integrate[Tan[x], {x, 0, π}]Regularize the divergence at
:
Integrate[Tan[x], {x, 0, π}, PrincipalValue -> True]Plot[Tan[x], {x, 0, Pi}, Filling -> Axis, FillingStyle -> {RGBColor[0.95, 0.627, 0.1425, 0.2], RGBColor[0.24, 0.6, 0.8, 0.2]}]Applications (67)
The Geometry of Integrals (5)
The integral
of a constant function
is the signed area of the rectangle of height
and width
:
Subsuperscript[∫, 1, 4]2ⅆx% == 2×(4 - 1)Subsuperscript[∫, 1, 4](-1)ⅆx% == (-1)×(4 - 1)Plot[{2, -1}, {x, 1, 4}, Filling -> Axis]The integral
of a piecewise-constant function is the sum of the signed areas of the rectangles defined by its plot:
f[x_] := Piecewise[{{0, x < 0}, {1, Inequality[0, LessEqual, x, Less, 1]},
{-2, Inequality[1, LessEqual, x, Less, 3]}, {5, 3 <= x}}]Subsuperscript[∫, 0, 4]f[x]ⅆx% == 1×(1 - 0) + (-2)(3 - 1) + 5×(4 - 3)Plot[f[x], {x, 0, 4}, Filling -> Axis, FillingStyle -> {RGBColor[0.95, 0.627, 0.1425, 0.2], RGBColor[0.24, 0.6, 0.8, 0.2]}]The integral
of a general function is the signed area between its plot and the horizontal axis:
f[x_] := x ^ 2 + 1Integrate[f[x], {x, 0, 2}]Plot[f[x], {x, 0, 2}, Filling -> Axis, AxesOrigin -> {0, 0}]This can be related to the piecewise-constant case by considering rectangles defined by its plot:
rectangles[f_, a_, b_, n_] := {Opacity[0.75], StandardOrange, N@Table[Rectangle[{a + k(b - a) / n, 0}, {a + (k + 1)(b - a) / n, f[a + k(b - a) / n]}], {k, 0, n - 1}]}For n5 on the interval [0,2], the rectangles are the following:
Plot[f[x], {x, 0, 2}, Epilog -> rectangles[f, 0, 2, 5], AxesOrigin -> {0, 0}]The area of these rectangles defines a Riemann sum that approximates the area under the curve:
RiemannSum[f_, a_, b_, n_] :=
Sum[f[(a + (b - a)k / n)], {k, 0, n - 1}] (b - a) / nRiemannSum[f, 0, 2, n]Using DiscreteLimit to obtain the exact answer as
gives the same answer as Integrate did:
DiscreteLimit[%, n -> ∞]Visualize the process for this function as well as three others:
label[f_, a_, b_, n_] := StringForm["TraditionalFormSubscriptBox[A, curve] == ``\ \ \ SubscriptBox[A, rects] = ``", NumberForm[N@Subsuperscript[∫, a, b]f[x]ⅆx, {4, 3}], NumberForm[N@RiemannSum[f, a, b, n], {4, 3}]]With[{a = 0, b = 2}, Manipulate[Plot[fn[x], {x, a, b}, Filling -> Axis, AxesOrigin -> {0, 0}, Epilog -> rectangles[fn, a, b, 2^n], PlotLabel -> label[fn, a, b, 2^n]], {{n, 1, Dynamic@StringForm["n = ``", 2^n]}, 1, 12, 1}, {{fn, f}, {f, CubeRoot, Sin, Abs[2# - 1]& -> HoldForm@2x - 1}}, SaveDefinitions -> True]]The Fundamental Theorem of Calculus relates a function to its integral from a fixed lower limit to a variable upper limit:
f[x_] := Sqrt[x ^ 2 + 1]Consider the definite integral of the this from from
to
:
g[x_] = Integrate[f[t], {t, 0, x}, Assumptions -> x > 0]The Fundamental Theorem of Calculus states that
:
Simplify[g'[x] == f[x]]This can be seen from the limit definition of derivative:
Limit[(g[x + h] - g[x]/h), h -> 0]Note that
is an area consisting of a rectangle of height
and width
plus a small correction that vanishes as
, as illustrated by the following table for
:
TableForm[Table[{h, (g[1 + h] - g[1]/h), (g[1 + h] - g[1]/h) - f[1]}, {h, {.1, .05, .001, 0.0005, 0.00001, 0.00000005}}], TableHeadings -> {{}, {h, HoldForm[(g[1 + h] - g[1]/h)], HoldForm[(g[1 + h] - g[1] - f[1]h/h)]}}]Hence, the limit can be seen geometrically to equal
, as illustrated in the following visualization:
title[u_, k_] := IconizedObject[«Code for plot title»]labels[u_, k_] := IconizedObject[«Code for labels in plot»]Manipulate[Plot[{Piecewise[{{f[s], 0 ≤ s ≤ u}, {Undefined, True}}], Piecewise[{{f[s], u ≤ s ≤ u + k}, {Undefined, True}}], f[s]}, {s, 0, 3}, PlotLabel -> title[u, k], Epilog -> labels[u, k], IconizedObject[«More Plot options»]], {{u, 1.5, Style[x, Italic, 14]}, 1, 2, Appearance -> {"Labeled"}, LabelStyle -> 14}, {{k, .25, Style[h, Italic, 14]}, 0.00001, .5, Appearance -> "Labeled", LabelStyle -> 14}, SaveDefinitions -> True]Integrate a discrete set of data with Interpolation:
data = Table[{x, Sin[(1/x + 1 / 2)]}, {x, 0, 10, 0.25}];Integrate[Interpolation[data][x], {x, 0, 10}]Compare with the exact area under the curved that was interpolated:
Integrate[Sin[(1/x + 1 / 2)], {x, 0, 10}]//N{ListLinePlot[data, Filling -> Axis, ImageSize -> Small, InterpolationOrder -> 0], Plot[Interpolation[data][x], {x, 0, 10}, Filling -> Axis, ImageSize -> Small]}Area Between Curves (7)
Compute the area under the curve of
from
to
:
Plot[1 + Sqrt[9 - x ^ 2], {x, -3, 0}, Filling -> Axis, AxesOrigin -> {0, 0}]Integrate[1 + Sqrt[9 - x ^ 2], {x, -3, 0}]Find the area under the curve of
from
to
:
Plot[Sin[x] ^ 2 Cos[x] ^ 4, {x, -π, π}, Filling -> Axis]Integrate[Sin[x] ^ 2 Cos[x] ^ 4, {x, -π, π}]Determine the total area enclosed between of
and the
-axis:
Plot[Sin[x], {x, -π, π}, Filling -> Axis]The total area is given by the integral of the absolute value:
Integrate[RealAbs[Sin[x]], {x, -π, π}]Equivalently compute this as the sum of two integrals of the difference between the top and bottom:
Subsuperscript[∫, -π, 0](0 - Sin[x])ⅆx + Subsuperscript[∫, 0, π](Sin[x] - 0)ⅆxCompute the area between
and
from
to
:
Plot[{5x - x ^ 2, x}, {x, 0, 4}, PlotLegends -> "Expressions", Filling -> {1 -> {2}}]Integrate[(5x - x ^ 2) - (x), {x, 0, 4}]Find the area enclosed by
and
:
pts = Solve[y == 2 / (1 + x ^ 4) && y == x ^ 2, {x, y}, Reals]Since
,
will be above
in the interval of interest and the area will equal:
Integrate[2 / (x ^ 4 + 1) - x ^ 2, {x, -1, 1}]%//NVisualize the region of interest and the two functions:
Show[RegionPlot[x^2 < y < (2/x^4 + 1), {x, -1, 1}, {y, 0, 2}], Plot[{2 / (1 + x ^ 4), x ^ 2}, {x, -2, 2}, PlotLegends -> "Expressions"], PlotRange -> All]Compute the area enclosed by
and
:
pts = Solve[y == Cos[x] && y == 1 - 2x / π && 0 ≤ x ≤ π, {x, y}]Find the area as the integral of the absolute value of the difference over the entire interval:
Integrate[RealAbs[Cos[x] - (1 - 2x / π)], {x, 0, π}]//ExpandVisualize the two functions and the area between them:
Show[RegionPlot[y ≤ Cos[x] && y ≥ 1 - 2x / π || y ≥ Cos[x] && y ≤ 1 - 2x / π, {x, 0, π}, {y, -2, 2}, PlotPoints -> 60, PlotStyle -> Opacity[.75]], Plot[{Cos[x], 1 - 2x / π}, {x, -1, 4}, PlotTheme -> "Detailed"], Graphics[{PointSize[Large], Point[{x, y} /. pts]}], PlotRange -> All, Axes -> True]Use the plot to split the integral into two equivalent integrals with no absolute value:
Subsuperscript[∫, 0, (π/2)](Cos[x] - (1 - (2 x/π)))ⅆx + Subsuperscript[∫, (π/2), π]((1 - (2 x/π)) - Cos[x])ⅆxTo compute the area enclosed by
,
, and
, first find the points of intersection:
pt1 = Solve[y == 1 / x ^ 2 && y == x, {x, y}, Reals]pt2 = Solve[y == 1 / x ^ 2 && y == (1 / 8)x, {x, y}, Reals]pt3 = Solve[y == (1 / 8)x && y == x, {x, y}, Reals]Visualize the three curves over an area containing the points:
ContourPlot[{y == 1 / x ^ 2, y == x, y == (1 / 8)x}, {x, -1, 3}, {y, -1, 2}, PlotLegends -> "Expressions", Axes -> True, AspectRatio -> Automatic, Epilog -> {PointSize[Large], Point[{x, y} /. Join[pt1, pt2, pt3]]}]From the plot, it is clear
is above the line
and below the other two curves:
reg = ImplicitRegion[y ≤ 1 / x ^ 2 && y ≤ x && y ≥ (1 / 8)x, {x, y}]RegionPlot[reg, AspectRatio -> Automatic]Area can be found using two integrals, one for each "top function":
Integrate[x - (1 / 8)x, {x, 0, 1}] + Integrate[1 / x ^ 2 - (1 / 8)x, {x, 1, 2}]This can be reduced to a single integral using Min:
Integrate[Min[x, 1 / x^2] - (1 / 8)x, {x, 0, 2}]Compare with the answer returned by Area:
Area[reg]Regions of Revolution (7)
Compute the volume enclosed when
for
is rotated about the
-axis:
Integrate[π(Sin[x] ^ 2) ^ 2, {x, 0, π}]RevolutionPlot3D[Sin[x] ^ 2, {x, 0, π}, RevolutionAxis -> "X"]Use cylindrical shells to find the volume enclosed when
,
, is rotated about the
-axis:
Integrate[2π x(x(x - 1) ^ 2), {x, 0, 1}]Visualize the solid, adding the cap at
:
Show[RevolutionPlot3D[{x(x - 1) ^ 2}, {x, 0, 1}], RevolutionPlot3D[0, {x, 0, 1}]]Find the volume of the region formed by rotating the area between
and
about the
-axis:
f[x_] := x
g[x_] := x^2Find where the curves intersect:
Solve[f[x] == g[x], x]Between these two values of
,
is above
:
Plot[{g[x], f[x]}, {x, 0, 1}, Filling -> {2 -> {1}}]RevolutionPlot3D[{{x, f[x]}, {x, g[x]}}, {x, 0, 1}, PlotStyle -> Opacity[.6]]Integrate cylindrical shells of height
and circumference
to find the volume:
Subsuperscript[∫, 0, 1]2π x(f[x] - g[x])ⅆxDetermine the volume the region above
and below
for
, rotated about the
-axis:
f[x_] := Csc[x]Find where the curves intersect, adding the constraint on the range of
:
Solve[f[x] == 2 && 0 ≤ x ≤ π, x]The relevant range of
values is between these two points:
Plot[{2, f[x]}, {x, 0, π}, Filling -> {2 -> {1}}, PlotRange -> {0, 2}]Show[RevolutionPlot3D[f[x], {x, (π/6), (5 π/6)}, RevolutionAxis -> {1, 0, 0}], Graphics3D[{Opacity[.5], Cylinder[{{0, 0, 0}, {π, 0, 0}}, 2]}], ViewPoint -> {2, -2.5, 1}, PlotRange -> {{π / 6, 5π / 6}, {-2, 2}, {-2, 2}}]Integrate washers of area
to find the volume:
Subsuperscript[∫, (π/6), (5 π/6)]π(2^2 - f[x]^2)ⅆx%//NCompute the surface area when
for
is rotated about the
-axis:
RevolutionPlot3D[x ^ 3, {x, 0, 1}]Apply the formula of the infinitesimal width of each strip:
w = Sqrt[1 + D[x ^ 3, x] ^ 2]Multiply the width by the circumference
of each circle and integrate:
Subsuperscript[∫, 0, 1]2 π x wⅆxFind the area when
for -
is rotated about the
-axis:
RevolutionPlot3D[Sqrt[x^2 + 1], {x, -Sqrt[3], Sqrt[3]}, RevolutionAxis -> "X"]The infinitesimal width of each strip is given by the following:
w = Sqrt[1 + D[Sqrt[x ^ 2 + 1], x]^2]Multiplying the width by the circumference
and integrating yields the answer:
Subsuperscript[∫, -Sqrt[3], Sqrt[3]]2 π Sqrt[x^2 + 1] wⅆxDetermine the surface area when
for
is rotated about line
:
f[x_] := 1 / xThe infinitesimal width of each strip is given by the following:
w = Sqrt[1 + D[f[x], x]^2]Since
for the curve in question, each strip has radius
and width
:
Subsuperscript[∫, 1, 3]2π(4 - x)wⅆxFind the numerical approximation of this value:
%//N//ChopVisualize the surface using modified cylindrical coordinates based on the line
,
:
ParametricPlot3D[{Cos[θ](x - 4) + 4, 1 / x, Sin[θ](x - 4)}, {x, 1, 3}, {θ, 0, 2π}, IconizedObject[«ParametricPlot3D options»]]Arc Length, Surface Area, and Volume (8)
Compute the arc length of the plot
from
to
:
f[x_] := (x^4/8) + (1/4 x^2)Plot[f[x], {x, 1, 2}, PlotRange -> {0, 2}]Apply the formula for infinitesimal arc length:
ds = Sqrt[1 + D[f[x], x] ^ 2]//SimplifyIntegrate to find the arc length:
Integrate[ds, {x, 1, 2}]Compare with the answer returned by ArcLength:
ArcLength[f[x], {x, 1, 2}]Compute the arc length of the plot
from
to
:
f[x_] := Sqrt[x - x^2] + ArcSin[Sqrt[x]]Plot[f[x], {x, 0, 1}]Apply the formula for infinitesimal arc length:
ds = Sqrt[1 + D[f[x], x] ^ 2]//SimplifyIntegrate to find the arc length:
Integrate[ds, {x, 0, 1}]Compare with the answer returned by ArcLength:
ArcLength[f[x], {x, 0, 1}]Length of a parametrically defined circle:
{x, y} = {2Cos[u], 2Sin[u]};The relevant parameter range is
to
:
ParametricPlot[{x, y}, {u, 0, 2π}]The infinitesimal arc length is constant:
ds = Sqrt[D[x, u] ^ 2 + D[y, u] ^ 2]//SimplifyIntegrate to find the total arc length:
Integrate[ds, {u, 0, 2π}]Compare with the answer returned by ArcLength:
ArcLength[{x, y}, {u, 0, 2π}]Length of a 3D parametrically defined ellipse:
c[u_] = {1, 0, 0}2Cos[u] + Normalize[{0, 1, 1}]Sin[u]ParametricPlot3D[c[u], {u, 0, 2π}]The infinitesimal arc length is non-constant:
ds = Sqrt[c'[u].c'[u]]Integrate to find the total arc length:
Integrate[ds, {u, 0, 2π}]%//NCompare with the answer returned by ArcLength:
ArcLength[c[u], {u, 0, 2π}]Find the surface area of the plot
over the rectangle
:
f[x_, y_] := x^2 + y^2Plot3D[f[x, y], {x, 0, 1}, {y, 0, 1}, BoxRatios -> Automatic]Apply the formula for infinitesimal surface area of a plot:
dA = Sqrt[1 + D[f[x, y], x] ^ 2 + D[f[x, y], y] ^ 2]//SimplifyIntegrate to find the arc length:
Integrate[dA, {x, 0, 1}, {y, 0, 1}]%//NCompare with the answer returned by Area:
Area[f[x, y], {x, 0, 1}, {y, 0, 1}]Find the area of the surface
where
:
s[u_, v_] := {(2 + Cos[v])Cos[u], (2 + Cos[v])Sin[u], Sin[v]}ParametricPlot3D[s[u, v], {u, 0, 2π}, {v, 0, 2π}]Apply the formula for infinitesimal surface area of a parametric surface:
dA = Simplify[Norm[Subscript[∂, u]s[u, v]⨯Subscript[∂, v]s[u, v]], {u, v}∈ℝ]Integrate to find the total surface area:
Integrate[dA, {u, 0, 2π}, {v, 0, 2π}]Compare with the answer returned by Area:
Area[s[u, v], {u, 0, 2π}, {v, 0, 2π}]Find the volume of the following parametric region, where
,
:
ρ[r_, u_, v_] := {(2 + r Cos[v])Cos[u], (2 + r Cos[v])Sin[u], Sin[v]}ParametricPlot3D[ρ[1, u, v], {u, 0, 2Pi}, {v, 0, 2Pi}]Compute the Jacobian determinant:
j = Simplify[RealAbs[Det[Grad[ρ[r, u, v], {r, u, v}]]], 0 ≤ r ≤ 1 && 0 ≤ v ≤ 2π]Subsuperscript[∫, 0, 1]Subsuperscript[∫, 0, 2 π]Subsuperscript[∫, 0, 2π]jⅆuⅆvⅆrCompare with the answer returned by Volume:
Volume[ρ[r, u, v], {r, 0, 1}, {u, 0, 2Pi}, {v, 0, 2Pi}]Find the volume of the following parametric region, where
,
, and
:
ρ[r_, θ_, ψ_] := {3r Cos[ψ], 2r Sin[θ]Sin[ψ], r Cos[θ]Sin[ψ]}ParametricPlot3D[ρ[1, θ, ψ], {θ, 0, 2Pi}, {ψ, 0, Pi}]Compute the Jacobian determinant:
j = Simplify[RealAbs[Det[Grad[ρ[r, θ, ψ], {r, θ, ψ}]]], 0 ≤ r ≤ 1 && 0 ≤ ψ ≤ π]Subsuperscript[∫, 0, 1]Subsuperscript[∫, 0, 2 π]Subsuperscript[∫, 0, π]jⅆψⅆθⅆrCompare with the answer returned by Volume:
Volume[ρ[r, θ, ψ], {r, 0, 1}, {θ, 0, 2Pi}, {ψ, 0, Pi}]Line Integrals (6)
Compute the line integral
of
over the origin-centered ellipse with semi-major axes
and
:
f[{x_, y_}] := x + y^2reg = Region[Circle[{0, 0}, {2, 1}], Axes -> True]c[t_] := {2Cos[t], Sin[t]}ParametricPlot[c[t], {t, 0, 2Pi}]Perform the integral using the fact that
:
Subsuperscript[∫, 0, 2 π]f[c[t]] Norm[Derivative[1][c][t]]ⅆt%//NCompare the direct integral over the ellipse:
Underscript[∫, 𝕩∈reg]f[𝕩]Calculate the closed line integral
of
over the following parametric curve:
c[t_] := {Cos[t], Sin[2t]}The curve forms an infinity figure, traversed from red to purple as shown in the following plot:
Show[ParametricPlot[{Cos[x], Sin[2x]}, {x, 0, 2Pi}, PlotTheme -> "Detailed", ColorFunction -> (Hue[0.8#3]&)]]v[{x_, y_}] := {x y, 3y ^ 2}Perform the calculation using the definition
:
Integrate[v[c[t]].c'[t], {t, 0, 2π}]To calculate ∫x4dx+x yy over the triangle with vertices
,
, and
, define the associated vector field:
v[{x_, y_}] := {x^4, x y}Parametrize the triangle using a piecewise-linear parametrization:
c[t_] = Piecewise[{{{0, 0} + t*({1, 0} - {0, 0}), 0 <= t <= 1}, {{1, 0} + (t - 1)*({0, 1} - {1, 0}),
1 <= t <= 2}, {{0, 1} + (t - 2)*({0, 0} - {0, 1}), 2 <= t <= 3}, {Indeterminate, True}}]The parametrization is oriented counter-clockwise:
ParametricPlot[c[t], {t, 0, 3}, PlotTheme -> "FrameGrid", ColorFunction -> (Hue[0.8#3]&)]Compute the line integral from the definition
:
Integrate[v[c[t]].c'[t], {t, 0, 3}]Calculate the work done by the force
as a particle takes the following path from
,
, to
,
:
c[t_] := {a Cos[t], b Sin[t], t(t - Pi / 2)}Define the force field as function from points to vectors:
F[{x_, y_, z_}] := -(G M m{x, y, z}/(x^2 + y^2 + z^2)^3 / 2)The work done is the line integral
:
Integrate[F[c[t]].c'[t], {t, 0, Pi / 2}, Assumptions -> {a > 0, b > 0}]//ExpandFind a potential function for the following vector field:
v[{x_, y_, z_}] := {x ^ 2, y ^ 2, z ^ 2}This is possible because the vector field is conservative:
Curl[v[{x, y, z}], {x, y, z}]Define a family of straight-line curves that go from the origin at time
to
at time
:
Subscript[c, {x_, y_, z_}][t_] := t{x, y, z}Let
be the line integral of
from the origin to the point
:
ϕ[{x_, y_, z_}] = Subsuperscript[∫, 0, 1]v[Subscript[c, {x, y, z}][t]].D[Subscript[c, {x, y, z}][t], t]ⅆtVerify that
is a potential function for
using Grad
Grad[ϕ[{x, y, z}], {x, y, z}] == v[{x, y, z}]Use Green's Theorem to find the area of the area enclosed by the following curve:
c[u_] := {Cos[u] + 1 / 7Cos[7u + π / 3], Sin[u] + 1 / 7Sin[7u]};ParametricPlot[c[u], {u, 0, 2π}]The following vector-field has a two-dimensional Curl of
:
v[{x_, y_}] := {0, x}Curl[v[{x, y}], {x, y}]Apply Green's theorem in the form
to compute the area:
Subsuperscript[∫, 0, 2 π]v[c[u]].Derivative[1][c][u]ⅆuSurface and Volume Integrals (7)
Use Green's Theorem to compute
over the circle centered at the origin with radius 3:
v[x_, y_] := {3y^3 - Exp[Sin[x]], 7x^2 + Sqrt[y^4 + 1]}Visualize the vector field and circle for the line integral:
VectorPlot[v[x, y], {x, -3, 3}, {y, -3, 3}, Epilog -> Circle[{0, 0}, 3], PlotRangePadding -> None]The circulation of the vector field can be computed using Curl:
circ = Curl[v[x, y], {x, y}]Integrate over the interior of the circle:
Subsuperscript[∫, -3, 3]Subsuperscript[∫, -Sqrt[9 - y^2], Sqrt[9 - y^2]]circⅆxⅆyPerform the integral using region notation:
Underscript[∫, {x, y}∈Disk[{0, 0}, 3]]circCompute the integral over the unit sphere of
:
f[{x_, y_, z_}] := (x + y + z)^4s[θ_, φ_] := {Sin[θ]Cos[φ], Sin[θ]Sin[φ], Cos[θ]}Determine infinitesimal surface area:
dS = Simplify[Norm[Subscript[∂, θ]s[θ, φ]⨯Subscript[∂, φ]s[θ, φ]], 0 ≤ θ ≤ π && -π < φ < π]Subsuperscript[∫, 0, 2π]Subsuperscript[∫, 0, π]f[s[θ, φ]]dSⅆθⅆφCompare with a region integral:
Subscript[∫, 𝕏∈Sphere[]]f[𝕏]Verify Stoke's theorem for
for the upper unit hemisphere:
v[{x_, y_, z_}] := {-y, x, x ^ 2 - y ^ 2}Parameterize the surface using standard spherical coordinates:
s[u_, v_] := {Sin[u]Cos[v], Sin[u]Sin[v], Cos[u]}Visualize the surface and the vector field:
Show[ParametricPlot3D[s[u, v], {u, 0, Pi / 2}, {v, 0, 2Pi}], VectorPlot3D[v[{x, y, z}], {x, -1, 1}, {y, -1, 1}, {z, 0, 1}], PlotRange -> {{-1, 1}, {-1, 1}, {0, 1}}]The boundary of the surface is the unit circle in the
-plane:
c[t_] := {Cos[t], Sin[t], 0}Compute the curl of the vector field:
curl[{x_, y_, z_}] = Curl[v[{x, y, z}], {x, y, z}]Compute the oriented surface area element on the hemisphere:
dS = Subscript[∂, u]s[u, v]⨯Subscript[∂, v]s[u, v]//SimplifyStoke's theorem,
, states that line integral of
on boundary equals the flux integral of its curl through the surface:
Subsuperscript[∫, 0, (π/2)]Subsuperscript[∫, 0, 2 π]curl[s[u, v]].dSⅆvⅆu == Subsuperscript[∫, 0, 2 π]v[c[t]].Derivative[1][c][t]ⅆtUse the divergence theorem to compute the flux of
through the surface bounded above by
, below by
, and on the side by
and
:
ContourPlot3D[{y + z == 2, z == 1 - x ^ 2, z == 0, y == 0}, {x, -1.5, 1.5}, {y, 0, 2}, {z, 0, 1}, ContourStyle -> Opacity[0.5], Mesh -> None]The divergence theorem,
, relates the flux to the volume integral of the divergence:
Subsuperscript[∫, -1, 1]Subsuperscript[∫, 0, 1 - x^2]Subsuperscript[∫, 0, 2 - z]Div[{x y, y^2 + E^x z^2, Sin[x y]}, {x, y, z}]ⅆyⅆzⅆxUse Gauss's Theorem to find the volume enclosed by the following parametric surface:
s[u_, v_] := {(2 + Cos[v])Cos[u], (2 + Cos[v])Sin[u], Sin[v](5 / 4 - Cos[u])}ParametricPlot3D[s[u, v], {u, 0, 2π}, {v, 0, 2π}]The oriented area element on the surface is given by the following:
dA = Subscript[∂, u]s[u, v]⨯Subscript[∂, v]s[u, v]//FullSimplifyThe following vector-field has a divergence equal
:
v[{x_, y_, z_}] := (1/3){x, y, z}Div[v[{x, y, z}], {x, y, z}]Apply Gauss's Theorem in the form
to compute the volume:
Integrate[v[s[u, v]].dA, {u, 0, 2π}, {v, 0, 2π}]Given a mass density
, find the mass of region given by the following:
φ[u_, v_, w_] := {(5 + 2w Cos[v])Cos[u], 2Sin[v], (5 + 2w Cos[v])Sin[u]};The ranges of the parameters are
and
, producing a filled torus:
ParametricPlot3D[φ[u, v, 1], {u, 0, 2π}, {v, 0, 2π}]Enter the mass density function:
ρ[{x_, y_, z_}] := (2 - y^2)(x^2 + z^2)Compute the Jacobian determinate:
jac = Simplify[RealAbs@Det[Grad[φ[u, v, w], {u, v, w}]], 0 ≤ w ≤ 1 && v∈Reals]Integrate to find the total mass:
Integrate[ρ[φ[u, v, w]]jac, {u, 0, 2π}, {v, 0, 2π}, {w, 0, 1}]Derive a formula for the integral of
over an
-dimensional unit ball:
Table[Integrate[Sum[Indexed[x, i] ^ 2, {i, n}], x∈Ball[n]], {n, 10}]FindSequenceFunction[%, n]Table[(n π^n / 2/2 Gamma[2 + (n/2)]), {n, 10}]Average Values and Centroids (6)
Compute the average value of
between
and
:
(Subsuperscript[∫, 0, π]Cos[x]^4 Sin[x]ⅆx/π - 0)Visualize the function and its average value:
Plot[{Cos[x] ^ 4Sin[x], 2 / (5π)}, {x, 0, π}]Find the mean of
over the parallelogram based at the origin with sides
and
:
reg = Region[Parallelogram[{0, 0}, {{1, 0}, {1, 2}}], ImageSize -> Small, Axes -> True]As
, the mean is given by the following ratio of integrals:
(Integrate[x + y, {y, 0, 2}, {x, y / 2, y / 2 + 1}]/Integrate[1, {y, 0, 2}, {x, y / 2, y / 2 + 1}])Express the integrals using region notation:
(Integrate[x + y, {x, y}∈reg]/Area[reg])Visualize the function and its mean value:
Plot3D[{x + y, 2}, {x, y}∈reg, BoxRatios -> {1, 1, 1}]To compute the centroid of the region under the curve of
from
to
, first find the area:
a = Integrate[2x, {x, 0, 1}]The centroid equals the average value of the coordinates:
xcentroid = (1 / a)Integrate[x, {x, 0, 1}, {y, 0, 2x}]ycentroid = (1 / a)Integrate[y, {x, 0, 1}, {y, 0, 2x}]Compare with the answer given by RegionCentroid:
p = RegionCentroid[ImplicitRegion[0 ≤ y ≤ 2x && 0 ≤ x ≤ 1, {x, y}]]Show[Plot[2x, {x, 0, 1}, Filling -> Axis], Graphics[{PointSize[Large], Point[p]}]]Determine the centroid of the region between the curves
and
from
to
:
a = Integrate[Sqrt[x] - x ^ 2, {x, 0, 1}]xcentroid = (1 / a)Integrate[x(Sqrt[x] - x ^ 2), {x, 0, 1}]ycentroid = (1 / a)Integrate[(1 / 2)((Sqrt[x]) ^ 2 - (x ^ 2) ^ 2), {x, 0, 1}]Compare with the answer returned by RegionCentroid:
p = RegionCentroid[ImplicitRegion[x ^ 2 ≤ y ≤ Sqrt[x] && 0 ≤ x ≤ 1, {x, y}]]Visualize the region and its centroid:
Show[Plot[{x ^ 2, Sqrt[x]}, {x, 0, 1}, Filling -> {1 -> {2}}, PlotLegends -> "Expressions"], Graphics[{PointSize[Large], Point[p]}]]Derive general formulas for the centroid of the region under the curve
from
to
using the fact that the integral gives the area under the curve:
A = Subsuperscript[∫, a, b]f[x]ⅆx;The
centroid is the mean value of
over the region from
to
and from
to
:
(1/A)Subsuperscript[∫, a, b]Subsuperscript[∫, 0, f[x]]xⅆyⅆxThe
centroid is similarly the mean value of
:
(1/A)Subsuperscript[∫, a, b]Subsuperscript[∫, 0, f[x]]yⅆyⅆxFind the center of mass of the origin-centered hemisphere of radius
with
:
reg = Region[ImplicitRegion[x ^ 2 + y ^ 2 + z ^ 2 ≤ 3 && y ≥ 0, {x, y, z}]]First compute the volume of the region:
v = Integrate[1, 𝕏∈reg]The center of mass is the average value of the position vector:
cm = (1/v)Integrate[𝕏, 𝕏∈reg]Show[RegionPlot3D[DiscretizeRegion@reg, Mesh -> None, Axes -> True, PlotStyle -> Opacity[1 / 2]], Graphics3D[{StandardCyan, Sphere[cm, 0.1]}]]Probability, Expectation, and Standard Deviation (7)
Compute the probability that
when
follows a standard normal distribution:
pdf = PDF[NormalDistribution[0, 1], x]Integrate[Boole[(x - 2) ^ 2 < 1]pdf, {x, -∞, ∞}]Compare with the value returned by Probability:
Probability[(x - 2) ^ 2 < 1, xNormalDistribution[0, 1]]Compute the probability that
for an exponential distribution with mean
. The mean is the reciprocal of the parameter:
Mean[ExponentialDistribution[μ]]Thus, use the probability density function (PDF) for ExponentialDistribution[5/2]:
PDF[ExponentialDistribution[(5/2)], x]Integrate[(5 / 2)E ^ (-5t / 2), {t, 4, ∞}]Since the PDF vanishes for
, the probability that
is the integral from
to
:
Integrate[(5 / 2)E ^ (-5t / 2), {t, 0, 2}]The corresponding probabilistic statements:
Probability[x > 4, xExponentialDistribution[5 / 2]]Probability[x < 2, xExponentialDistribution[5 / 2]]//ExpandCompute the probability that a value is within two standard deviations of the mean in a normal distribution:
(1/σ Sqrt[2 π])Subsuperscript[∫, μ - 2 σ, μ + 2 σ]Exp[-((x - μ)^2/2 σ^2)]ⅆxCompare with the answer returned by Probability:
Probability[μ - 2σ ≤ x ≤ μ + 2σ, xNormalDistribution[μ, σ]]N[Erf[Sqrt[2]]]This can be interpreted as saying that about
of the entire area under the curve lies between
and
in the following plot:
p[x_] = PDF[NormalDistribution[0, 1], x];
tr[x_] = Piecewise[{{p[x], -2 <= x <= 2}, {Indeterminate, True}}];
Plot[{p[x], tr[x]}, {x, -3, 3}, Filling -> Axis, AxesLabel -> {x / σ, p}]Compute the expectation of
when
follows a standard Cauchy distribution:
pdf = PDF[CauchyDistribution[0, 1], x]Integrate[Sqrt[Abs[x]] pdf, {x, -∞, ∞}]Compare with the answer returned by Expectation:
Expectation[Sqrt[Abs[x]], xCauchyDistribution[0, 1]]Mean and variance of the normal distribution:
Integrate[x PDF[NormalDistribution[μ, σ], x], {x, -∞, ∞}, Assumptions -> σ > 0]Integrate[(x - μ) ^ 2PDF[NormalDistribution[μ, σ], x], {x, -∞, ∞}, Assumptions -> σ > 0]Compare with the built in functions Mean and Variance:
{Mean[NormalDistribution[μ, σ]], Variance[NormalDistribution[μ, σ]]}Show that the standard deviation of an exponential distribution with mean μ is also μ:
Refine[Sqrt[(1/μ)Subsuperscript[∫, 0, ∞]E^-x / μ(x - μ)^2ⅆx], μ > 0]Compare with the answers returned by Mean and StandardDeviation:
dist = ExponentialDistribution[1 / μ];{Mean[dist], StandardDeviation[dist]}Compute the cumulative distribution function (CDF) from the probability density function (PDF):
pdf[x_] = PDF[NormalDistribution[0, 1], x]cdf[x_] = Integrate[pdf[x], {x, -∞, x}]The CDF gives the area under the PDF curve from
to
:
Manipulate[Plot[{pdf[x], cdf[x]}, {x, -3, u}, Filling -> {1 -> Axis}, PlotTheme -> "Detailed", PlotRange -> {{-3, 3}, {0, 1}}, PlotLabel -> x == u], {{u, 0, x}, -3.01, 3}, SaveDefinitions -> True]Integral Transforms (7)
ft[f_, x_, ω_] := (1/Sqrt[2π])Integrate[f Exp[I ω x], {x, -∞, ∞}]ft[Exp[-x ^ 2], x, ω]Compare with FourierTransform:
FourierTransform[Exp[-x ^ 2], x, ω]lt[f_, x_, s_] := Integrate[f Exp[-s x], {x, 0, ∞}]lt[x ^ 2, x, s]Compare with LaplaceTransform:
LaplaceTransform[x ^ 2, x, s]ht[f_, x_, ω_] := (1/Sqrt[2π])Integrate[f(Cos[ω x] + Sin[ω x]), {x, -∞, ∞}]ht[Exp[-x ^ 2], x, ω]Since the function is even, the Hartley transform is equivalent to FourierCosTransform:
FourierCosTransform[Exp[-x ^ 2], x, ω]Find the Fourier coefficients of a function on [0,1]:
a[0] = 2Integrate[x^2, {x, 0, 1}]a[i_] = 2Integrate[x^2 Cos[2π i x], {x, 0, 1}, Assumptions -> i∈ℤ]b[i_] = 2Integrate[x^2 Sin[2π i x], {x, 0, 1}]Define the partial sums of the transform:
s[n_] := a[0] / 2 + Subsuperscript[∑, i = 1, n]a[i]Cos[2π i x] + Subsuperscript[∑, i = 1, n]b[i]Sin[2π i x]Visualize the partial sums, which exhibit the Gibbs phenomenon due to the aperiodicity of
:
Plot[{x ^ 2, s[#]}, {x, 0, 1}, PlotTheme -> {"Minimal"}, PlotLabel -> n == #, ImageSize -> 225]& /@ Range[2, 8, 2]mt[f_, x_, s_] := Integrate[f x ^ (s - 1), {x, 0, ∞}]mt[Sin[x], x, s]Compare with MellinTransform:
MellinTransform[Sin[x], x, s, GenerateConditions -> True]ht[f_, r_, s_, ν_] := Integrate[r f BesselJ[ν, r s], {r, 0, ∞}, Assumptions -> s > 0 && ν > -1 / 2]ht[1 / r, r, s, 0]Compare with HankelTransform:
HankelTransform[1 / r, r, s, ν]Compute a quadratic fractional Fourier transform in closed form:
fract[α_, w_] = Sqrt[(1 - I Cot[α]) / (2π)]E ^ (I Cot[α] w ^ 2 / 2) Integrate[E ^ (-I Csc[α] w t + I Cot[α] t ^ 2 / 2) UnitBox[t], {t, -∞, ∞}]Visualize the real and imaginary parts of the transform for different values of α:
Table[Plot[{Re[fract[α, w]], Im[fract[α, w]]}, {w, -2, 2}, Filling -> Axis, PlotRange -> All, ImageSize -> 225, PlotLabel -> α == α], {α, {0.02π, 0.09π, 3.2π, 20.9π}}]sReal and Complex Analysis (4)
Define the standard
norm of a univariate function:
lp[p_, f_, x_] := Integrate[Abs[f] ^ p, {x, -∞, ∞}, Assumptions -> p ≥ 1] ^ (1 / p)Also define a formatting for this function:
Format[HoldPattern[lp[p_, f_, x_]]] := HoldForm[Norm[f, L^p]]Compute the norms as a function of
for three different functions:
f := Exp[-x^2];
g := Exp[-5 x^2];
h := HeavisideTheta[x] Exp[-5 x^2];{lp[p, f, x], lp[p, g, x], lp[p, h, x]}The norm is always eventually an increasing function of
, but it may be initially decreasing:
Plot[{lp[p, f, x], lp[p, g, x], lp[p, h, x]}, {p, 1, 12}, PlotTheme -> "Detailed", Evaluated -> True, PlotRange -> All]The Fourier transform is an
isomorphism (the norm of the function and its transform are equal):
Table[lp[2, fn, x] == lp[2, FourierTransform[fn, x, k], k], {fn, {f, g}}]//FullSimplifyIt is not, however, an
isomorphism for any other value, for example for
:
Table[lp[1, fn, x] == lp[1, FourierTransform[fn, x, k], k], {fn, {f, g, h}}]Define the weighted inner product for
, with weight
for functions defined on
:
ip[w_, f_, g_, {x_, a_, b_}] := Integrate[w f Conjugate[g], {x, a, b}]Orthogonality of Legendre polynomials
on
with weight function
:
Table[ip[1, LegendreP[n, x], LegendreP[m, x], {x, -1, 1}], {n, 0, 4}, {m, 0, 4}]//MatrixFormOrthogonality of Chebyshev polynomials
on
with weight function
:
Table[ip[(1/Sqrt[1 - x ^ 2]), ChebyshevT[n, x], ChebyshevT[m, x], {x, -1, 1}], {n, 0, 4}, {m, 0, 4}]//MatrixFormOrthogonality of Hermite polynomials
on
with weight function
:
Table[ip[Exp[-x ^ 2], HermiteH[n, x], HermiteH[m, x], {x, -∞, ∞}], {n, 0, 4}, {m, 0, 4}]//MatrixFormDefine an inner product on functions using Integrate:
dot[f_, g_] := (2/π)Subsuperscript[∫, -1, 1]Conjugate[f]gSqrt[1 - x^2]ⅆxConstruct an orthonormal basis using using Orthogonalize:
Orthogonalize[{1, x, x^2, x^3, x^4}, dot]//ExpandThis inner product produces the Gegenbauer polynomials:
Table[GegenbauerC[n, 1, x], {n, 0, 4}]Compute the residue of
at
as an integral over a contour enclosing
:
res[f_, {z_, c_}] := Underscript[, r -> 0^ + ](1/2 π I)Subsuperscript[∫, 0, 2 π](f Dt[z, t] /. z -> c + Exp[I t])ⅆtres[(2/z - 1), {z, 1}]res[(Sin[z]/(z - 2) ^ 3), {z, 2}]Compare with the answers returned by Residue:
Residue[(2/z - 1), {z, 1}]Residue[(Sin[z]/(z - 2) ^ 3), {z, 2}]Integral Representation of Special Functions (3)
Represent HermiteH in terms of Integrate:
Assuming[{Re[z] > 0, n∈ℤ}, FullSimplify[HermiteH[n, z] == (2^n Subsuperscript[∫, -∞, ∞]((z + I t)^n/E^t^2)ⅆt/Sqrt[π])]]Visualize the first five Hermite polynomials:
Plot[Table[HermiteH[n, z], {n, 0, 4}]//Evaluate, {z, 0, 4}, PlotTheme -> {"Detailed", "DashedLines"}]Express Gamma in terms of a logarithmic integral:
Simplify[Gamma[z] == Integrate[Log[1 / t] ^ (z - 1), {t, 0, 1}], Re[z] > 0]Plot[Gamma[z], {z, 0, 5}]Represent Zeta in terms of Integrate:
FullSimplify[Zeta[s] == (1/Gamma[s])Subsuperscript[∫, 0, ∞](t^s - 1/E^t - 1)ⅆt, Re[s] > 1]Properties & Relations (14)
Integration is a linear operator:
f[x_] = E ^ x;g[x_] = x ^ 2 + 4x + 17;∫(f[x] + b g[x])ⅆx == ∫f[x]ⅆx + b ∫g[x]ⅆx//SimplifyIndefinite integration is the inverse of differentiation:
f[x_] := x ^ n + x ^ -nIntegrate[f[x], x]f[x] == D[%, x]Definite integration can be defined in terms of DiscreteLimit and Sum:
f[x_] := 1 / xSubsuperscript[∫, 1, 3]f[x]ⅆx == Underscript[, nUnderscript[ -> , ℤ]∞]Underoverscript[∑, k = 0, n - 1]f[1 + k((3 - 1)/n)](3 - 1/n)Evaluate integrals numerically using N:
Integrate[Sin[Sin[x]], {x, 0, 1}]N[%]This effectively calls NIntegrate:
NIntegrate[Sin[Sin[x]], {x, 0, 1}]Derivative with a negative integer order does integrals:
Derivative[-2][Function[x, x ^ n]][x]Integrate[x ^ n, x, x]//FactorArcLength is the integral of 1 over a one-dimensional region:
Underscript[∫, {x, y}∈Circle[]]1ArcLength[Circle[]]Area is the integral of 1 over a two-dimensional region:
Underscript[∫, {x, y, z}∈Sphere[]]1Area[Sphere[]]Volume is the integral of 1 over a three-dimensional region:
Underscript[∫, {x, y, z}∈Ball[]]1Volume[Ball[]]RegionMeasure for a region
is given by the integral
:
ℛ = Circle[];{RegionMeasure[ℛ], Integrate[1, {x, y}∈ℛ]}ℛ = Ball[];{RegionMeasure[ℛ], Integrate[1, {x, y, z}∈ℛ]}RegionCentroid is equivalent to Integrate[p,p∈ℛ]/m with m=RegionMeasure[ℛ]:
ℛ = Sphere[{1, 2, 3}];
m = RegionMeasure[ℛ];{RegionCentroid[ℛ], Integrate[p, p∈ℛ] / m}Solve a simple differential equation:
Integrate[Sin[x], x]DSolveValue returns a solution with the constant of integration:
DSolveValue[y'[x] == Sin[x], y[x], x]DSolve returns a substitution rule for the solution:
DSolve[y'[x] == Sin[x], y, x]Integrate computes the integral in closed form:
closed = Integrate[Sin[x t] ^ 2, {t, 0, 1}]AsymptoticIntegrate gives series approximating the exact result:
AsymptoticIntegrate[Sin[x t] ^ 2, {t, 0, 1}, {x, 0, 8}]Series[closed, {x, 0, 8}]//NormalFourierTransform is defined in terms of an integral:
FourierTransform[Exp[-t ^ 2] Sin[t], t, ω] == Subsuperscript[∫, -∞, ∞]Exp[-t^2] Sin[t]( Exp[I ω t]/Sqrt[2 π])ⅆt//SimplifyLaplaceTransform is defined in terms of an integral:
LaplaceTransform[Exp[-t ^ 2] Sin[t], t, s] == Subsuperscript[∫, 0, ∞]Exp[-t^2] Sin[t] Exp[-s t]ⅆt//FullSimplifyPossible Issues (13)
Indefinite Integrals (6)
Many simple integrals cannot be evaluated in terms of standard mathematical functions:
Integrate[Sin[x] / Log[x], x]The indefinite integral of a continuous function can be discontinuous:
f[x_] := 1 / (2 + Sin[x])Plot[{f[x], Integrate[f[x], x]}, {x, 0, 2π}, PlotTheme -> "Detailed", Evaluated -> True]Using a definite integral with a variable upper limit can smooth the discontinuity. Find the discontinuity to the left of the plot:
Solve[Integrate[f[x], x] == 0 && -π < x < 0, x]In this case, integrating from previous discontinuity reproduces the values of the indefinite integral in the range
:
Assuming[{x∈Reals}, Plot[{f[x], Integrate[f[t], {t, -2 ArcTan[(1/2)], x}]}, {x, 0, 2π}, PlotTheme -> "Detailed", Evaluated -> True, Filling -> {1 -> 0}]]The derivative of an integral may not come out in the same form as the original function:
Integrate[1 / Sqrt[a^2 - x ^ 2], x]D[%, x]Simplify and related constructs can often show equivalence:
Simplify[%]Different forms of the same integrand can give integrals that differ by constants of integration:
Integrate[1 + (x + 1) ^ 3, x]Integrate[Expand[1 + (x + 1) ^ 3], x]Simplify[%% - %]Parameters like
are assumed to be generic inside indefinite integrals:
Integrate[x ^ n, x]Integrate[x ^ -1, x]Use definite integration with a variable upper limit to generate conditions:
Integrate[t ^ n, {t, 0, x}]When part of a sum cannot be integrated explicitly, the whole sum will stay unintegrated:
Integrate[f[x] + f'[x], x]Integrate[f[x], x] + Integrate[f'[x], x]Definite Integrals (7)
Substituting limits into an indefinite integral may not give the correct result for a definite integral:
Integrate[1 / (2 + Cos[x]), {x, 0, 2π}]expr = Integrate[1 / (2 + Cos[x]), x](expr /. x -> 2π) - (expr /. x -> 0)The presence of a discontinuity in the expression for the indefinite integral leads to the anomaly:
Plot[expr, {x, 0, 2π}]Specifying integer assumptions may not give a simpler result:
Integrate[k Cos[k x], {x, -π, π}, Assumptions -> k∈Integers]Use Simplify and related functions to obtain the expected result:
Simplify[%, k∈Integers]One can specify a real range as an assumption:
Integrate[Exp[-x] LaguerreL[n, x] ^ 2, {x, 0, Infinity}, Assumptions -> Element[n, PositiveReals]]Numeric integration agrees with this for n=π:
NIntegrate[Exp[-x] LaguerreL[Pi, x] ^ 2, {x, 0, Infinity}]It happens that this integral does converge on a subset of zero measure, the positive integers:
Integrate[Exp[-x] LaguerreL[3, x] ^ 2, {x, 0, Infinity}]A discrete subcase specification such as integrality will still give the generic result:
Integrate[Exp[-x] LaguerreL[n, x] ^ 2, {x, 0, Infinity}, Assumptions -> Element[n, PositiveIntegers]]A definite integral may have a closed form only over an infinite interval:
Integrate[BesselJ[2, x] / (1 + x ^ 2), {x, 0, 1}]Integrate[BesselJ[2, x] / (1 + x ^ 2), {x, 0, ∞}]Integrals over regions do not test whether an integrand is absolutely integrable:
Integrate[(x^2 - y^2/(x^2 + y^2)^2), {x, y}∈Rectangle[{0, 0}, {1, 1}]]Underscript[, a -> 0^ + ]Integrate[Abs[(x^2 - y^2/(x^2 + y^2)^2)], {x, y}∈Rectangle[{a, a}, {1, 1}]]Answers may then depend on how the region was decomposed for integration:
Integrate[(x ^ 2 - y ^ 2) / (x ^ 2 + y ^ 2) ^ 2, {x, 0, 1}, {y, 0, 1}]Integrate[(x ^ 2 - y ^ 2) / (x ^ 2 + y ^ 2) ^ 2, {y, 0, 1}, {x, 0, 1}]Integrals over zero-dimensional regions use the counting measure:
ℛ = RegionIntersection[Ball[{0, 0, 0}, Sqrt[14]], Ball[{2, 4, 6}, Sqrt[14]]]Integrate[x + y + z, {x, y, z}∈ℛ]To use the measure of the ambient space, integrate over all space with the added condition
:
Integrate[(x + y + z) Boole[{x, y, z}∈ℛ], {x, y, z}∈FullRegion[3]]Setting GenerateConditions to False may produce unexpected answers:
Integrate[1 / x, {x, 0, a}, GenerateConditions -> False]In this case, the condition that the integral is divergent was lost:
Integrate[1 / x, {x, 0, a}]Interactive Examples (1)
Consider Gabriel's horn, the interior of rotating
around the
axis for
:
f[x_] := 1 / xCompute the volume for arbitrary endpoint
:
v[a_] = Integrate[π f[x] ^ 2, {x, 1, a}, Assumptions -> a > 1]Compute the surface area for arbitrary endpoint
:
s[a_] = Integrate[2π f[x]Sqrt[1 + D[f[x], x] ^ 2], {x, 1, a}, Assumptions -> a > 1]The limit as
of the volume is finite, but the surface area is infinite:
Underscript[, a -> ∞]{v[a], s[a]}Visualize the horn along with its volume and surface area as functions of
:
Manipulate[Column[{Style[a == b//TraditionalForm, FontSize -> 14], RevolutionPlot3D[1 / s, {s, 1, b}, RevolutionAxis -> {1, 0, 0}, PlotRange -> {{1, 15}, {-1, 1}, {-1, 1}}, Mesh -> None, ImageSize -> 300, Ticks -> None, Boxed -> False], Show[Plot[{s[x], v[x]}, {x, 1, 16}, ImageSize -> Small, PlotLegends -> {"Surface Area" == NumberForm[s[b], {5, 3}], "Volume" == NumberForm[v[b], {4, 3}]}], Graphics[{StandardOrange, PointSize[Large], Point[{b, v[b]}], StandardBlue, Point[{b, s[b]}]}]]}, Alignment -> Center], {{b, 5., a}, 1.01, 15}, SaveDefinitions -> True]Neat Examples (2)
The first six Borwein-type integrals are all exactly
:
Table[Subsuperscript[∫, 0, ∞](Underoverscript[∏, k = 0, max](Sin[(x/2 k + 1)]/(x/2 k + 1)))ⅆx, {max, 6}]From the seventh onward, they differ from
by small amounts, for example the eighth:
Subsuperscript[∫, 0, ∞](Underoverscript[∏, k = 0, 8](Sin[(x/2 k + 1)]/(x/2 k + 1)))ⅆxN[% - Pi / 2]A logarithmic integral from Srinivasa Ramanujan's notebooks:
Integrate[Log[(1 + Sqrt[1 + 4x]) / 2] / x, {x, 0, 1}]See Also
NIntegrate AsymptoticIntegrate LineIntegrate SurfaceIntegrate ContourIntegrate Asymptotic DSolve Sum LaplaceTransform FourierTransform Convolve D Derivative CDF Expectation Probability ArcLength Area Volume MomentOfInertia FractionalD CaputoD ResidueSum
Characters: \[Integral] \[DifferentialD]
Function Repository: FractionalIntegrate RiemannSum
Related Guides
Related Links
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0) ▪ 2003 (5.0) ▪ 2014 (10.0) ▪ 2019 (12.0) ▪ 2026 (15.0)
Text
Wolfram Research (1988), Integrate, Wolfram Language function, https://reference.wolfram.com/language/ref/Integrate.html (updated 2026).
CMS
Wolfram Language. 1988. "Integrate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/Integrate.html.
APA
Wolfram Language. (1988). Integrate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Integrate.html
BibTeX
@misc{reference.wolfram_2026_integrate, author="Wolfram Research", title="{Integrate}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/Integrate.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_integrate, organization={Wolfram Research}, title={Integrate}, year={2026}, url={https://reference.wolfram.com/language/ref/Integrate.html}, note=[Accessed: 13-June-2026]}