> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/zh-tw/shu-xue/09-integrals-sums-and-limits.md).

# 積分、總和與上下限

## 積分

積分表達式可以使用以下方式加入 `\int_{lower}^{upper}` 指令。

請注意，積分表達式在行內與顯示數學模式下看起來可能會有些不同。

| LaTeX 程式碼                          | 輸出                                                                                     |
| ---------------------------------- | -------------------------------------------------------------------------------------- |
| `文字中的積分 \(\int_{a}^{b} x^2 \,dx\)` | ![Example of an integral inside text](/files/78ca8d59709a602c37dba936ee3aef5f0bf89e12) |
| `\[ \int_{a}^{b} x^2 \,dx \]`      | ![Example of an integral](/files/88de580593d2ea6249395d36d1183e776de18c26)             |

## 多重積分

若要取得二重／三重／多重積分以及循環積分，你必須使用 `amsmath` 和 `esint` （用於循環積分）的套件。

| LaTeX 程式碼                                                                                                                                                                                                                             | 輸出                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `latex<br>\begin{gather*}<br> \iint_V \mu(u,v) \,du\,dv<br>\\<br> \iiint_V \mu(u,v,w) \,du\,dv\,dw<br>\\<br> \iiiint_V \mu(t,u,v,w) \,dt\,du\,dv\,dw<br>\\<br> \idotsint_V \mu(u_1,\dots,u_k) \,du_1 \dots du_k<br>\end{gather*}<br>` | ![Example of multiple integrals](/files/d0da4c84faaee68ceb9078d4b7014a067a26f923) |
| `latex<br>\[<br> \oint_V f(s) \,ds<br>\]<br>`                                                                                                                                                                                         | ![Example of integrals](/files/44daf05d14c71f470ba970c84d266cb0f3e081ce)          |

## 總和與乘積

與積分類似，總和表達式可以使用以下方式加入 `\sum_{lower}^{upper}` 指令。

| LaTeX 程式碼                                 | 輸出                                                                                        |
| ----------------------------------------- | ----------------------------------------------------------------------------------------- |
| `文字中的總和 $\sum_{n=1}^{\infty} 2^{-n} = 1$` | ![Example of sum expression inside text](/files/74f2da6936aa6471171f143492f4935a85ab72eb) |
| `\[ \sum_{n=1}^{\infty} 2^{-n} = 1 \]`    | ![Example of sum expression](/files/163123f8b464300acb104903baef2d95af6fd2cf)             |

以類似方式，你可以使用以下方式得到由一系列因子組成的乘積表達式 `\prod_{lower}^{upper}` 指令。

| LaTeX 程式碼                       | 輸出                                                                                          |
| ------------------------------- | ------------------------------------------------------------------------------------------- |
| `文字中的乘積 $\prod_{i=a}^{b} f(i)$` | ![Example of limit expression inside text](/files/758dcd3ab3cf32a6a69bdc335cfcb0c612e3d781) |
| `\[ \prod_{i=a}^{b} f(i) \]`    | ![Example of limit expression](/files/d197df2460374c569168925ccb0bd54bf53e120e)             |

## 極限

極限表達式可以使用以下方式加入 `\lim_{lower}` 指令。

| LaTeX 程式碼                         | 輸出                                                                                |
| --------------------------------- | --------------------------------------------------------------------------------- |
| `文字中的極限 $\lim_{x\to\infty} f(x)$` | ![Example of limits inside text](/files/402f099d8f9d102660f8017a1dd32f445d447207) |
| `\[ \lim_{x\to\infty} f(x) \]`    | ![Example of limits](/files/76664a2d45a791e2630a6569429391e8acc613b3)             |

## 範例

以下是一個 LaTeX 範例文件：

```latex
\documentclass{article}
\title{積分、總和與極限}
\author{Overleaf}
\date{}
\usepackage{amsmath}

\begin{document}

\maketitle

\section{積分}

積分 \(\int_{a}^{b} x^2 dx\) 於文字中。

\medskip

同一個積分的顯示式：
\[
    \int_{a}^{b} x^2 \,dx
\]
以及多重積分：
\begin{gather*}
    \iint_V \mu(u,v) \,du\,dv
\\
    \iiint_V \mu(u,v,w) \,du\,dv\,dw
\\
    \iiiint_V \mu(t,u,v,w) \,dt\,du\,dv\,dw
\\
    \idotsint_V \mu(u_1,\dots,u_k) \,du_1 \dots du_k
\\
    \oint_V f(s) \,ds
\end{gather*}

\section{總和與乘積}

文字中的總和 \(\sum_{n=1}^{\infty} 2^{-n} = 1\) 。

同一個總和的顯示式：
\[
    \sum_{n=1}^{\infty} 2^{-n} = 1
\]

文字中的乘積 \(\prod_{i=a}^{b} f(i)\) 。

同一個乘積的顯示式：
\[
    \prod_{i=a}^{b} f(i)
\]

\section{極限}

文字中的極限 \(\lim_{x\to\infty} f(x)\) 。

同一個極限的顯示式：
\[
    \lim_{x\to\infty} f(x)
\]

\end{document}
```

[在 Overleaf 中開啟這個範例](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Integrals%2C+Sums+and+Limits\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Ctitle%7BIntegrals%2C+Sums+and+Limits%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7B%7D%0A%5Cusepackage%7Bamsmath%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cmaketitle%0A%0A%5Csection%7BIntegrals%7D%0A%0AIntegral+%5C%28%5Cint_%7Ba%7D%5E%7Bb%7D+x%5E2+dx%5C%29+inside+text.%0A%0A%5Cmedskip%0A%0AThe+same+integral+on+display%3A%0A%5C%5B%0A++++%5Cint_%7Ba%7D%5E%7Bb%7D+x%5E2+%5C%2Cdx%0A%5C%5D%0Aand+multiple+integrals%3A%0A%5Cbegin%7Bgather%2A%7D%0A++++%5Ciint_V+%5Cmu%28u%2Cv%29+%5C%2Cdu%5C%2Cdv%0A%5C%5C%0A++++%5Ciiint_V+%5Cmu%28u%2Cv%2Cw%29+%5C%2Cdu%5C%2Cdv%5C%2Cdw%0A%5C%5C%0A++++%5Ciiiint_V+%5Cmu%28t%2Cu%2Cv%2Cw%29+%5C%2Cdt%5C%2Cdu%5C%2Cdv%5C%2Cdw%0A%5C%5C%0A++++%5Cidotsint_V+%5Cmu%28u_1%2C%5Cdots%2Cu_k%29+%5C%2Cdu_1+%5Cdots+du_k%0A%5C%5C%0A++++%5Coint_V+f%28s%29+%5C%2Cds%0A%5Cend%7Bgather%2A%7D%0A%0A%5Csection%7BSums+and+products%7D%0A%0ASum+%5C%28%5Csum_%7Bn%3D1%7D%5E%7B%5Cinfty%7D+2%5E%7B-n%7D+%3D+1%5C%29+inside+text.%0A%0AThe+same+sum+on+display%3A%0A%5C%5B%0A++++%5Csum_%7Bn%3D1%7D%5E%7B%5Cinfty%7D+2%5E%7B-n%7D+%3D+1%0A%5C%5D%0A%0AProduct+%5C%28%5Cprod_%7Bi%3Da%7D%5E%7Bb%7D+f%28i%29%5C%29+inside+text.%0A%0AThe+same+product+on+display%3A%0A%5C%5B%0A++++%5Cprod_%7Bi%3Da%7D%5E%7Bb%7D+f%28i%29%0A%5C%5D%0A%0A%5Csection%7BLimits%7D%0A%0ALimit+%5C%28%5Clim_%7Bx%5Cto%5Cinfty%7D+f%28x%29%5C%29+inside+text.%0A%0AThe+same+limit+on+display%3A%0A%5C%5B%0A++++%5Clim_%7Bx%5Cto%5Cinfty%7D+f%28x%29%0A%5C%5D%0A%0A%5Cend%7Bdocument%7D)

## 延伸閱讀

更多資訊請參見

* [數學表達式](/latex/zh-tw/shu-xue/01-mathematical-expressions.md)
* [下標與上標](/latex/zh-tw/shu-xue/02-subscripts-and-superscripts.md)
* [分數與二項式](/latex/zh-tw/shu-xue/05-fractions-and-binomials.md)
* [數學模式中的顯示樣式](/latex/zh-tw/shu-xue/10-display-style-in-math-mode.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/zh-tw/shu-xue/09-integrals-sums-and-limits.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
