> 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/vi/toan-hoc/01-mathematical-expressions.md).

# Biểu thức toán học

## Giới thiệu

Các tính năng dàn trang toán học của LaTeX khiến nó trở thành một lựa chọn hấp dẫn để viết tài liệu kỹ thuật. Bài viết này trình bày những lệnh cơ bản nhất cần có để bắt đầu viết toán học bằng LaTeX.

Viết các phương trình cơ bản trong LaTeX rất đơn giản, ví dụ:

```latex
\documentclass{article}
\begin{document}

Định lý Pythagore nổi tiếng \(x^2 + y^2 = z^2\) đã
được chứng minh là không đúng với các số mũ khác.
Điều đó có nghĩa là phương trình tiếp theo không có nghiệm nguyên:

\[ x^n + y^n = z^n \]

\end{document}
```

[Mở ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Basic+math+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%0AThe+well+known+Pythagorean+theorem+%5C%28x%5E2+%2B+y%5E2+%3D+z%5E2%5C%29+was+%0Aproved+to+be+invalid+for+other+exponents.+%0AMeaning+the+next+equation+has+no+integer+solutions%3A%0A%0A%5C%5B+x%5En+%2B+y%5En+%3D+z%5En+%5C%5D%0A%0A%5Cend%7Bdocument%7D)

![Ví dụ về phương trình toán học](/files/0287f5cf8ae378eb8f17292837796fab67aa1b09)

Như bạn thấy, cách các phương trình được hiển thị phụ thuộc vào dấu phân cách, trong trường hợp này là `\[...\]` và `\(...\)`.

## Các chế độ toán học

LaTeX cho phép hai chế độ viết cho các biểu thức toán học: *nội dòng* chế độ toán học và *hiển thị* chế độ toán học:

* *nội dòng* chế độ toán học được dùng để viết các công thức là một phần của đoạn văn
* *hiển thị* chế độ toán học được dùng để viết các biểu thức không phải là một phần của đoạn văn, và vì thế được đặt trên các dòng riêng

### Chế độ toán học nội dòng

Bạn có thể dùng bất kỳ "dấu phân cách" nào trong số này để dàn trang toán học ở chế độ nội dòng:

* `\(...\)`
* `$...$`
* `\begin{math}...\end{math}`

Tất cả chúng đều hoạt động và việc chọn cái nào là do sở thích, vì vậy hãy xem một vài ví dụ.

```latex
\documentclass{article}
\begin{document}

\noindent Cách chuẩn của \LaTeX{} là viết toán học nội dòng bằng cách đặt nó giữa \verb|\(...\)|:

\begin{quote}
Trong vật lý, sự tương đương khối lượng-năng lượng được nêu
bằng phương trình \(E=mc^2\), được Albert Einstein phát hiện vào năm 1905.
\end{quote}

\noindent Thay vào đó, nếu viết (đặt) toán học nội dòng giữa \verb|\(...\)|, bạn có thể dùng \texttt{\$...\$} để đạt cùng kết quả:

\begin{quote}
Trong vật lý, sự tương đương khối lượng-năng lượng được nêu
bằng phương trình $E=mc^2$, được Albert Einstein phát hiện vào năm 1905.
\end{quote}

\noindent Hoặc, bạn có thể dùng \verb|\begin{math}...\end{math}|:

\begin{quote}
Trong vật lý, sự tương đương khối lượng-năng lượng được nêu
bằng phương trình \begin{math}E=mc^2\end{math}, được Albert Einstein phát hiện vào năm 1905.
\end{quote}
\end{document}
```

[Mở ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Basic+inline+math+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cnoindent+Standard+%5CLaTeX%7B%7D+practice+is+to+write+inline+math+by+enclosing+it+between+%5Cverb%7C%5C%28...%5C%29%7C%3A%0A%0A%5Cbegin%7Bquote%7D%0AIn+physics%2C+the+mass-energy+equivalence+is+stated+%0Aby+the+equation+%5C%28E%3Dmc%5E2%5C%29%2C+discovered+in+1905+by+Albert+Einstein.%0A%5Cend%7Bquote%7D%0A%0A%5Cnoindent+Instead+if+writing+%28enclosing%29+inline+math+between+%5Cverb%7C%5C%28...%5C%29%7C+you+can+use+%5Ctexttt%7B%5C%24...%5C%24%7D+to+achieve+the+same+result%3A%0A%0A%5Cbegin%7Bquote%7D%0AIn+physics%2C+the+mass-energy+equivalence+is+stated+%0Aby+the+equation+%24E%3Dmc%5E2%24%2C+discovered+in+1905+by+Albert+Einstein.%0A%5Cend%7Bquote%7D%0A%0A%5Cnoindent+Or%2C+you+can+use+%5Cverb%7C%5Cbegin%7Bmath%7D...%5Cend%7Bmath%7D%7C%3A%0A%0A%5Cbegin%7Bquote%7D%0AIn+physics%2C+the+mass-energy+equivalence+is+stated+%0Aby+the+equation+%5Cbegin%7Bmath%7DE%3Dmc%5E2%5Cend%7Bmath%7D%2C+discovered+in+1905+by+Albert+Einstein.%0A%5Cend%7Bquote%7D%0A%5Cend%7Bdocument%7D)

![Ví dụ về phương trình nội dòng](/files/caf003ff3a3602a1d21b414a893639a60195f173)

### Chế độ toán học hiển thị

Dùng một trong các cấu trúc sau để dàn trang toán học ở chế độ hiển thị:

* `\[...\]`
* `\begin{displaymath}...\end{displaymath}`
* `\begin{equation}...\end{equation}`

Chế độ toán học hiển thị có hai phiên bản tạo ra phương trình có số hoặc không có số. Hãy xem một ví dụ cơ bản:

```latex
\documentclass{article}
\begin{document}
Sự tương đương khối lượng-năng lượng được mô tả bằng phương trình nổi tiếng

\[E=mc^2\]

được Albert Einstein phát hiện vào năm 1905.
Trong các đơn vị tự nhiên ($c$ = 1), công thức biểu thị đẳng thức

\begin{equation}
E=m
\end{equation}
\end{document}
```

[Mở ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Basic+math+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AThe+mass-energy+equivalence+is+described+by+the+famous+equation%0A%0A%5C%5BE%3Dmc%5E2%5C%5D%0A%0Adiscovered+in+1905+by+Albert+Einstein.+%0AIn+natural+units+%28%24c%24+%3D+1%29%2C+the+formula+expresses+the+identity%0A%0A%5Cbegin%7Bequation%7D%0AE%3Dm%0A%5Cend%7Bequation%7D%0A%5Cend%7Bdocument%7D)

![Displayex.png](/files/b889f8c19b82a99d9d898bc94b31e69a1243764a)

## Một ví dụ khác

Ví dụ sau sử dụng `equation*` môi trường được cung cấp bởi `amsmath` gói—xem [`amsmath` article](/latex/vi/toan-hoc/06-aligning-equations-with-amsmath.md) để biết thêm thông tin.

```latex
\documentclass{article}
\usepackage{amsmath} % cho môi trường equation*
\begin{document}

Đây là một biểu thức toán học đơn giản \(\sqrt{x^2+1}\) trong văn bản.
Và đây cũng là như vậy:
\begin{math}
\sqrt{x^2+1}
\end{math}
nhưng bằng cách dùng một lệnh khác.

Đây là một biểu thức toán học đơn giản không có đánh số
\[\sqrt{x^2+1}\]
tách khỏi văn bản.

Đây cũng là như vậy:
\begin{displaymath}
\sqrt{x^2+1}
\end{displaymath}

\ldots và đây:
\begin{equation*}
\sqrt{x^2+1}
\end{equation*}

\end{document}
```

[Mở ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Typesetting+maths+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D+%25+for+the+equation%2A+environment%0A%5Cbegin%7Bdocument%7D%0A%0AThis+is+a+simple+math+expression+%5C%28%5Csqrt%7Bx%5E2%2B1%7D%5C%29+inside+text.+%0AAnd+this+is+also+the+same%3A+%0A%5Cbegin%7Bmath%7D%0A%5Csqrt%7Bx%5E2%2B1%7D%0A%5Cend%7Bmath%7D%0Abut+by+using+another+command.%0A%0AThis+is+a+simple+math+expression+without+numbering%0A%5C%5B%5Csqrt%7Bx%5E2%2B1%7D%5C%5D+%0Aseparated+from+text.%0A%0AThis+is+also+the+same%3A%0A%5Cbegin%7Bdisplaymath%7D%0A%5Csqrt%7Bx%5E2%2B1%7D%0A%5Cend%7Bdisplaymath%7D%0A%0A%5Cldots+and+this%3A%0A%5Cbegin%7Bequation%2A%7D%0A%5Csqrt%7Bx%5E2%2B1%7D%0A%5Cend%7Bequation%2A%7D%0A%0A%5Cend%7Bdocument%7D)

![Amsexample.png](/files/f420dfcb037fe00ac62308383828507216b56ced)

## Hướng dẫn tham khảo

Dưới đây là một bảng với một số ký hiệu toán học phổ biến. Để xem danh sách đầy đủ hơn, hãy xem [Danh sách các chữ cái Hy Lạp và ký hiệu toán học](/latex/vi/toan-hoc/11-list-of-greek-letters-and-math-symbols.md):

| mô tả                | mã                                                | ví dụ                                                           |
| -------------------- | ------------------------------------------------- | --------------------------------------------------------------- |
| Các chữ cái Hy Lạp   | `\alpha \beta \gamma \rho \sigma \delta \epsilon` | $$\alpha \ \beta \ \gamma \ \rho \ \sigma \ \delta \ \epsilon$$ |
| Các toán tử nhị phân | `\times \otimes \oplus \cup \cap`                 | $$\times \ \otimes \ \oplus \ \cup \ \cap$$                     |
| Các toán tử quan hệ  | `< > \subset \supset \subseteq \supseteq`         | $$< \ >\ \subset \ \supset \ \subseteq \ \supseteq$$            |
| Khác                 | `\int \oint \sum \prod`                           | $$\int \ \oint \ \sum \ \prod$$                                 |

Các lớp ký hiệu toán học khác nhau được đặc trưng bởi kiểu định dạng khác nhau (ví dụ, các biến được in nghiêng, nhưng [các toán tử](/latex/vi/toan-hoc/07-operators.md) thì không) và các [khoảng cách](/latex/vi/toan-hoc/08-spacing-in-math-mode.md).

## Đọc thêm

Chế độ toán học trong LaTeX rất linh hoạt và mạnh mẽ, có thể làm được nhiều hơn thế nữa với nó:

* [Chỉ số dưới và chỉ số trên](/latex/vi/toan-hoc/02-subscripts-and-superscripts.md)
* [Dấu ngoặc và ngoặc tròn](/latex/vi/toan-hoc/03-brackets-and-parentheses.md)
* [Phân số và nhị thức](/latex/vi/toan-hoc/05-fractions-and-binomials.md)
* [Căn chỉnh phương trình](/latex/vi/toan-hoc/06-aligning-equations-with-amsmath.md)
* [Các toán tử](/latex/vi/toan-hoc/07-operators.md)
* [Khoảng cách trong chế độ toán học](/latex/vi/toan-hoc/08-spacing-in-math-mode.md)
* [Tích phân, tổng và giới hạn](/latex/vi/toan-hoc/09-integrals-sums-and-limits.md)
* [Kiểu hiển thị trong chế độ toán học](/latex/vi/toan-hoc/10-display-style-in-math-mode.md)
* [Danh sách các chữ cái Hy Lạp và ký hiệu toán học](/latex/vi/toan-hoc/11-list-of-greek-letters-and-math-symbols.md)
* [Phông chữ toán học](/latex/vi/toan-hoc/12-mathematical-fonts.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/vi/toan-hoc/01-mathematical-expressions.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.
