Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
ContourIntegrate
  • See Also
    • NContourIntegrate
    • LineIntegrate
    • Integrate
    • NIntegrate
    • FunctionMeromorphic
    • ResidueSum
    • FunctionPoles
    • InverseLaplaceTransform
    • InverseZTransform
    • InverseMellinTransform
  • Related Guides
    • Functions of Complex Variables
    • See Also
      • NContourIntegrate
      • LineIntegrate
      • Integrate
      • NIntegrate
      • FunctionMeromorphic
      • ResidueSum
      • FunctionPoles
      • InverseLaplaceTransform
      • InverseZTransform
      • InverseMellinTransform
    • Related Guides
      • Functions of Complex Variables

ContourIntegrate[f,z∈cont]

gives the integral of f along the contour defined by cont in the complex plane.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Special Topic: Rational Functions  
Special Topic: Meromorphic Functions  
Show More Show More
Special Topic: Functions with Essential Singularities  
Special Topic: Non-analytic Functions  
Special Topic: Functions with Branch Cuts  
Special Topic: Symbolic Parameters  
Special Topic: Named Contours  
Special Topic: Region Contours  
Options  
Assumptions  
GenerateConditions  
PrincipalValue  
WorkingPrecision  
Applications  
Rational Functions  
Trig-Rational Products  
Trigonometric Functions  
Show More Show More
Fourier Transform  
Inverse Laplace Transform  
Inverse Mellin Transform  
Inverse Z Transform  
Classical Theorems  
Properties & Relations  
Interactive Examples  
Neat Examples  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • NContourIntegrate
    • LineIntegrate
    • Integrate
    • NIntegrate
    • FunctionMeromorphic
    • ResidueSum
    • FunctionPoles
    • InverseLaplaceTransform
    • InverseZTransform
    • InverseMellinTransform
  • Related Guides
    • Functions of Complex Variables
    • See Also
      • NContourIntegrate
      • LineIntegrate
      • Integrate
      • NIntegrate
      • FunctionMeromorphic
      • ResidueSum
      • FunctionPoles
      • InverseLaplaceTransform
      • InverseZTransform
      • InverseMellinTransform
    • Related Guides
      • Functions of Complex Variables

ContourIntegrate

ContourIntegrate[f,z∈cont]

gives the integral of f along the contour defined by cont in the complex plane.

Details and Options

  • Contour integration is also known as path integration or complex line integration.
  • Contour integrals arose in the study of holomorphic and meromorphic functions in complex analysis, but they are now used in a wide range of applications, including the computation of inverse Laplace transforms and Z transforms, definite integrals and sums, and solutions of partial differential equations.
  • The contour integral of a function along a contour cont is given by:
  • The value of the contour integral is independent of the parametrization, but it does depend on the orientation of the contour cont.
  • The function f is typically a meromorphic function of z, but it can be any piecewise continuous function that is defined in a neighborhood of cont in the complex plane.
  • The contour integral of a meromorphic function along a closed contour cont can be computed using Cauchy's residue theorem.
  • Commonly used closed contours cont include: »
  • {"Hairpin", hl}encircle a half-line hl
    {"UpperSemicircle",ipts,epts}encircle the upper half-plane, including the points ipts and excluding the points epts, all on the real axis
    {"LowerSemicircle",ipts,epts}encircle the lower half-plane, including the points ipts and excluding the points epts, all on the real axis
    {"Dumbbell",pt1,pt2}encircle the capsule given by points pt1 and pt2
  • The complex points are given as {x,y} pairs; complex half-lines are given as HalfLine primitives.
  • A contour cont in can also be specified as a curve region (RegionQ) in .
  • For a parametric contour ParametricRegion[{x[t],y[t]},{{t,a,b}}], the orientation is in the direction of increasing t.
  • Special contours in and their assumed orientation:
  • Line[{p1,p2,…}]from p1 to p2, etc.
    HalfLine[{p1,p1}]from p1 toward p2
    InfiniteLine[{p1,p2}]from p1 toward p2
    Circle[p,…]counterclockwise
  • Area regions such as Polygon can be used and the contours are then taken to be the boundary contours RegionBoundary[Polygon[…]].
  • Special area regions in and their assumed boundary contour orientation:
  • Triangle[{p1,p2,p3}]counterclockwise
    Rectangle[p1,p2]counterclockwise
    RegularPolygon[n,…]counterclockwise
    Polygon[{p1,p2,…}{{q1,q2,…},…}]counterclockwise of the outer contour, clockwise for inner contours
    Disk[p,…]counterclockwise
    Ellipsoid[p,…]counterclockwise
    StadiumShape[{p1,p2},r]counterclockwise
    Annulus[p,{rm,rm},…]counterclockwise for outer contour and clockwise for inner contour
  • ContourIntegrate uses a combination of symbolic and numerical methods when the input involves inexact quantities.
  • The regions in cont may be wrapped with Inactive to prevent autoevaluation.
  • The following options can be given:
  • Assumptions $Assumptionsassumptions to make about parameters
    GenerateConditions Automaticwhether to generate answers that involve conditions on parameters
    PrincipalValue Falsewhether to find Cauchy principal values
    WorkingPrecision Automaticthe precision used in internal computations

Examples

open all close all

Basic Examples  (3)

Integrate 1/z along the unit circle in the complex plane:

Integrate a rational function along a circle with center at the origin and radius 2:

Contour integral over a polygonal path:

Scope  (53)

Basic Uses  (5)

Contour integral over a circular path:

Numerical integration:

Contour integral over a polygonal chain in the complex plane:

Contour integrate over a half-disk:

Numerical contour integral:

Contour integral over a parametric contour in the complex plane:

Special Topic: Rational Functions  (13)

Integrate a rational function along a circle:

Integrate a parametric rational function along a circle:

Integrate a rational function along a pentagonal contour:

Contour integral of a rational function along a triangular path:

Contour integral of a rational function along a rectangular path:

Contour integral along the unit circle:

Contour integral over an open polygonal chain:

Contour integral over an open arc:

Contour integral of a meromorphic function over a closed semicircle:

Contour integral of a function with an essential singularity:

Contour integral of a non-analytic function:

Contour integral of a function containing a branch cut:

Contour integral of a function depending on a symbolic parameter:

Special Topic: Meromorphic Functions  (5)

Contour integral of a meromorphic function along a polygonal path:

Evaluate the contour integral numerically:

Contour integral along an elliptical path:

Contour integral over a closed semicircle:

Contour integral over a sector of annulus:

Contour integral over a circle of radius :

Special Topic: Functions with Essential Singularities  (4)

Exponential function:

Sin function with an essential singularity inside the contour:

Contour integral of a function with an essential singularity:

Essential singularity arising from a periodic function:

Special Topic: Non-analytic Functions  (4)

Contour integral over a circular path:

Contour integral of the Arg function:

Contour integral over an elliptic sector:

Contour integral over a rectangular path:

Special Topic: Functions with Branch Cuts  (2)

Contour integral of a piecewise continuous function:

Contour integral of a function with branch cuts on the integration path:

Special Topic: Symbolic Parameters  (5)

Function and contour can contain symbolic parameters:

Suppress conditions of existence using GenerateConditions  False:

Result is a Piecewise function:

Contour integral along a half-disk of radius :

Contour integral along a generic ellipse:

Contour integral along a half-annulus of radii and :

Special Topic: Named Contours  (8)

Contour integral along the real axis in positive direction, around poles on the real axis, closing in the upper half of the complex plane:

A second example:

Contour integral along the real axis in positive direction, around poles on the real axis, closing in the lower half of the complex plane:

By default, this contour is traversed clockwise.

A second example:

Contour integral around a hairpin or Hankel contour:

Integral around a hairpin or Hankel contour:

For the case :

Contour integral that evaluates to a Zeta function:

For the case , :

Contour integral on a hairpin:

For the case :

Hairpin or Hankel contour:

Dumbbell contour around the branch cut joining 0 and 1:

Special Topic: Region Contours  (7)

Contour integral over an infinite line:

For the case :

Contour integral over a circular contour:

Contour integral over a line segment:

Contour integral over a triangular path:

For the case :

Contour integral over a rectangular path:

Contour integral over a sector:

Contour integral over an annulus:

Options  (6)

Assumptions  (1)

The option Assumptions can be used on parameters:

GenerateConditions  (2)

ContourIntegrate generates conditions on parameters with GenerateConditionsAutomatic:

Use the option GenerateConditionsFalse to suppress the existence conditions:

Generate conditions when the contour involves parameters:

Suppress the conditions using GenerateConditionsFalse:

PrincipalValue  (1)

The option PrincipalValue can be used to calculate the Cauchy principal value:

WorkingPrecision  (2)

When WorkingPrecision is set, the integral is evaluated numerically:

If the input has a finite precision, the integral is evaluated numerically:

Applications  (22)

Rational Functions  (2)

Contour integral on a half-disk:

Limit for large :

The same result obtained with Integrate:

Integral over the real line:

This can be obtained as the limit of a contour integral:

Trig-Rational Products  (2)

Integrals on the real line:

This result can be recovered using a complex integral:

Integrals on the real line:

Use a complex integral:

Trigonometric Functions  (3)

Integral of a rational function of the sine:

This can be recovered as a contour integral:

Integral of a rational function of the cosine:

This can be obtained as a contour integral:

Integral of a rational function of the sine:

As a contour integral:

Fourier Transform  (2)

Fourier transform of a function:

Computation using a contour integral: for positive :

For negative :

Fourier transform of a function:

Computation using a contour integral: for positive :

For negative :

Inverse Laplace Transform  (4)

Inverse Laplace transform of a function:

Computation using a contour integral:

Inverse Laplace transform of a rational function:

Using a contour integral:

Inverse Laplace transform of a function containing a square root:

The same computation using a contour integral:

Inverse Laplace transform of a function containing Log:

Use the definition of the inverse Laplace transform:

Inverse Mellin Transform  (4)

Inverse Mellin transform of a function:

Compute it from a contour integral:

Inverse Mellin transform of a function:

Compute it from its definition as a contour integral:

Mellin transform of a function:

Recover the function using an inverse Mellin transform:

Mellin transform of a rational function:

Relation to the inverse Mellin transform:

Inverse Z Transform  (2)

Inverse Z transform of a function:

Obtain the result from its definition as a contour integral:

Inverse Z transform of a function:

Use its definition as a contour integral:

Classical Theorems  (3)

Residue theorem applied to the contour integral of a meromorphic function over a closed path:

The integral is equal to times the sum of the residues of the poles inside the contour:

The integration contour can be deformed without changing the value of the integral, provided that no singularities of the function are crossed:

If no singularities lie inside the contour, the integral is zero:

Properties & Relations  (6)

Apply N[ContourIntegrate[...]] to obtain a numerical solution if the symbolic calculation fails:

This can also be computed using NIntegrate:

Contour integrals can also be obtained using Integrate:

This is equivalent to:

Integrate can integrate along a straight contour in the complex plane:

This is equivalent to:

Contour integrals over a closed path can also be obtained using ResidueSum:

Poles of a meromorphic function can be found using FunctionPoles:

The integral can also be computed using Residue:

Contour integrals over a closed path can also be obtained using Residue:

Interactive Examples  (2)

Contour integral over a sector of varying radius:

Another contour integral over a sector of varying radius:

Neat Examples  (2)

Contour integral over a "Pacman" contour:

Contour integral of a meromorphic function along a "Ninja" contour:

See Also

NContourIntegrate  LineIntegrate  Integrate  NIntegrate  FunctionMeromorphic  ResidueSum  FunctionPoles  InverseLaplaceTransform  InverseZTransform  InverseMellinTransform

Related Guides

    ▪
  • Functions of Complex Variables

History

Introduced in 2023 (13.3)

Wolfram Research (2023), ContourIntegrate, Wolfram Language function, https://reference.wolfram.com/language/ref/ContourIntegrate.html.

Text

Wolfram Research (2023), ContourIntegrate, Wolfram Language function, https://reference.wolfram.com/language/ref/ContourIntegrate.html.

CMS

Wolfram Language. 2023. "ContourIntegrate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ContourIntegrate.html.

APA

Wolfram Language. (2023). ContourIntegrate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ContourIntegrate.html

BibTeX

@misc{reference.wolfram_2025_contourintegrate, author="Wolfram Research", title="{ContourIntegrate}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/ContourIntegrate.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_contourintegrate, organization={Wolfram Research}, title={ContourIntegrate}, year={2023}, url={https://reference.wolfram.com/language/ref/ContourIntegrate.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English