Composition in LaTeX (f \circ g)

f∘gf \circ g
LaTeX command
f \circ g
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Composition of f with g, meaning apply g first and then f to the result.

Composition is read right to left: (f \circ g)(x) = f(g(x)), and it is associative but usually not commutative. \circ is a binary operator, so spacing around it is automatic. Do not use a baseline \circ for degrees, which need ^{\circ}, and do not confuse it with \cdot or \bullet, which suggest multiplication. Repeated composition is often written f^{\circ n} to avoid ambiguity with powers f^n. The chain rule is the classic formula involving it: (f \circ g)'(x) = f'(g(x))\,g'(x), with the inner derivative on the right.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

(f∘g)′(x)=f′(g(x)) g′(x)(f \circ g)'(x) = f'(g(x))\, g'(x)
\documentclass{article}
\begin{document}
Composition: $f \circ g$

\[ (f \circ g)'(x) = f'(g(x))\, g'(x) \]
\end{document}

Related symbols

All الدوال والتعيين →

Frequently asked questions

How do I write Composition in LaTeX?
Type f \circ g in math mode, for example $(f \circ g)'(x) = f'(g(x))\, g'(x)$. It works in plain LaTeX without loading any package.
Which package do I need for f \circ g?
None. f \circ g is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use f \circ g in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $f \circ g$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث