2.2.8 · HinglishFunctions
Composition of functions — f(g(x)), g(f(x))
2.2.8· Maths › Functions
What IS Function Composition?
Yeh definition kyun? Hum "pehle karo, phir " ko ek single operation mein capture karna chahte hain. Notation ka matlab hai "woh function jo phir ko chain karke milti hai, par evaluate ki gayi."

The Mechanics: How to Compute
Step-by-step for :
- Evaluate the inner function: Pehle calculate karo
- Substitute into outer function: Us result ko mein input ki tarah use karo:
- Simplify: Like terms combine karo, expand karo, factor karo—jo bhi sahi lage
Yeh order kyun? Parentheses ke baare mein socho: mein, sabse andar ke parentheses pehle resolve karne padte hain, tabhi apply ho sakta hai.
Deriving Properties from First Principles
Property 1: Non-Comutativity
Claim: Generally,
Derivation:
- Definition se,
- Aur
- Yeh tabhi equal hote hain jab sabhi ke liye:
Yeh alag kyun honge? Functions inputs ko alag tarah transform karte hain. Agar double kare aur 3 add kare:
Clearly . Operations ka order matter karta hai, bilkul jaise agar hum distribute na kar sakte.
Property 2: Associativity
Claim:
Derivation:
\text{Left side: } ((h \circ g) \circ f)(x) &= (h \circ g)(f(x)) && \text{by definition of composition} \\ &= h(g(f(x))) && \text{apply } h \circ g \text{ to } f(x) \\ \\ \text{Right side: } (h \circ (g \circ f))(x) &= h((g \circ f)(x)) && \text{by definition} \\ &= h(g(f(x))) && \text{expand } (g \circ f)(x) \end{align}$$ Dono $h(g(f(x)))$ dete hain, isliye **composition associative hai**. Matlab aap functions ko chain kar sakte ho bina parentheses placement ki chinta ke—final result hamesha "pehle $f$, phir $g$, phir $h$" hi hoga. **Yeh kyun kaam karta hai?** Composition fundamentally evaluation order ke baare mein hai, jo function calls ki nesting se fix hota hai. $(h \circ g) \circ f$ mein parentheses nahi badlaate ki kaun sa function pehle chalta hai. ### Property 3: Identity Function **Claim:** $f \circ I = I \circ f = f$, jahan $I(x) = x$ **Derivation:** $$\begin{align} (f \circ I)(x) &= f(I(x)) = f(x) && \text{since } I(x) = x \\ (I \circ f)(x) &= I(f(x)) = f(x) && \text{since } I \text{ returns its input unchanged} \end{align}$$ ==Identity function== 1 se multiply karne ya 0 add karne jaisi hai—yeh kuch nahi karta, isliye iske saath compose karne se doosra function unchanged rehta hai. --- ## Worked Examples > [!example] Example 1: Basic Composition > **Diya gaya:** $f(x) = x^2 + 1$, $g(x) = 3x - 2$ > **Dhundho:** $(f \circ g)(x)$ aur $(g \circ f)(x)$ > **Solution:** > **$(f \circ g)(x) = f(g(x))$ ke liye:** > 1. **Inner function pehle:** $g(x) = 3x - 2$ > *Yeh step kyun?* Notation $f(g(x))$ batata hai ki $g$, $f$ ka input hai. > > 2. **$f$ mein substitute karo:** $f(g(x)) = f(3x-2) = (3x-2)^2 + 1$ > *Kyun?* $f$ ke formula mein har $x$ ki jagah expression $3x-2$ replace karo. > > 3. **Expand karo:** $(3x-2)^2 + 1 = 9x^2 - 12x + 4 + 1 = 9x^2 - 12x + 5$ > *Expand kyun?* Composite function ko standard form mein simplify karta hai. > > $$\boxed{(f \circ g)(x) = 9x^2 - 12x + 5}$$ > > **$(g \circ f)(x) = g(f(x))$ ke liye:** > 1. $f(x) = x^2 + 1$ > 2. $g(f(x)) = g(x^2 + 1) = 3(x^2+1) - 2 = 3x^2 + 3 - 2$ > 3. $= 3x^2 + 1$ > $$\boxed{(g \circ f)(x) = 3x^2 + 1}$$ > > **Notice karo:** $9x^2 - 12x + 5 \neq 3x^2 + 1$, jo confirm karta hai ki $f \circ g \neq g \circ f$. > [!example] Example 2: Domain Restrictions > **Diya gaya:** $f(x) = \sqrt{x}$, $g(x) = x - 4$ > **Dhundho:** $(f \circ g)(x)$ ka Domain > > **Solution:** 1. **Composite compute karo:** $(f \circ g)(x) = f(g(x)) = f(x-4) = \sqrt{x-4}$ > *Yeh step kyun?* Domain constraints dhundhne ke liye explicit formula chahiye. > > 2. **$g$ ka domain:** Saari real numbers ($x$ mein se kuch bhi 4 subtract karna kaam karta hai) > *Yeh kyun check karein?* Hum tabhi compose kar sakte hain jab $x$ pehle $g$ ke domain mein ho. > > 3. **$g$ ki range, $f$ ke domain mein fit honi chahiye:** > - $f$ ko input $\geq 0$ chahiye (reals mein negatives ka square root nahi hota) > - Isliye $g(x) \geq 0$ chahiye, yaani $x - 4 \geq 0$ > *Kyun?* $g$ ka output $f$ ka input ban jaata hai. Agar $g$, $-1$ produce kare, toh $f$ wahan undefined hai. > > 4. **Solve karo:** $x - 4 \geq 0 \implies x \geq 4$ > > $$\boxed{\text{Domain of } (f \circ g) = [4, \infty)}$$ > > **Key insight:** Composite ka domain sirf outer function ka domain nahi hota—puri chain trace karni padti hai. > [!example] Example 3: Component Functions Dhundhna > **Diya gaya:** $h(x) = (2x+1)^3$ > **Dhundho:** Functions $f$ aur $g$ aisa ki $h = f \circ g$ > > **Solution:** > **Strategy:** "Inner" operation aur "outer" operation identify karo. > 1. **Inner operation:** Expression $2x+1$ pehle compute hoti hai (jaise ingredients tayaar karna) > Maano $g(x) = 2x + 1$ > *Kyun?* $(2x+1)^3$ mein, cubing se pehle linear part compute karna padta hai. > > 2. **Outer operation:** Result ko cube karna > Maano $f(x) = x^3$ > *Kyun?* Ek baar $2x+1$ mil jaaye, agla step third power tak raise karna hai. > > 3. **Verify karo:** $(f \circ g)(x) = f(g(x)) = f(2x+1) = (2x+1)^3 = h(x)$ ✓ > > $$\boxed{g(x) = 2x+1, \quad f(x) = x^3}$$ > > **Note:** Yeh decomposition unique nahi hai! Aap $g(x) = x$ aur $f(x) = (2x+1)^3$ bhi choose kar sakte ho, lekin pehla wala zyada useful hai kyunki yeh linear aur polynomial operations alag karta hai. > [!example] Example 4: Teen Functions Compose Karna > **Diya gaya:** $f(x) = x+2$, $g(x) = x^2$, $h(x) = 3x$ > **Dhundho:** $(h \circ g \circ f)(5)$ > > **Solution:** > > **Method:** Sabse inner function se bahar ki taraf kaam karo. > 1. **Pehle $f$ apply karo:** $f(5) = 5 + 2 = 7$ > *Kyun?* Notation $h \circ g \circ f$ mein, $f$ sabse right mein hai, isliye yeh input par pehle act karta hai. > > 2. **Us result par $g$ apply karo:** $g(7) = 7^2 = 49$ > *Kyun?* $g$, $f$ ke output ko process karta hai. > > 3. **Aakhir mein $h$ apply karo:** $h(49) = 3 \cdot 49 = 147$ > *Kyun?* $h$ sabse outer function hai, isliye yeh final intermediate result par act karta hai. > > $$\boxed{(h \circ g \circ f)(5) = 147}$$ > > **General formula:** $(h \circ g \circ f)(x) = h(g(f(x))) = h(g(x+2)) = h((x+2)^2) = 3(x+2)^2$ --- ## Common Mistakes (aur Yeh Sahi Kyun Lagte Hain) > [!mistake] Mistake 1: $f \circ g$ aur $g \circ f$ Mein Confusion > **Galat soch:** "$f \circ g$ ka matlab hai $f$ pehle apply karo kyunki $f$ pehle likha hai." > **Yeh sahi kyun lagta hai:** English mein hum left-to-right padhte hain, aur $f$ visually $g$ se pehle aata hai. > > **Sach:** Circle notation $\circ$ **right-to-left** padha jaata hai. $(f \circ g)(x) = f(g(x))$ ka matlab hai "$g$ pehle, phir $f$"—sabse right wala function input par act karta hai. > > **Mistake ko samjho:** Agar hum composition ko ek operator $f * g$ ki tarah likhte jiska matlab "pehle $f$ karo phir $g$," toh confusion khatam ho jaata. Lekin mathematical convention function application order follow karta hai: $f(g(x))$ mein, $g(x)$ pehle evaluate hota hai (innermost parentheses). > > **Fix kaise karein:** Hamesha notation expand karo: $f \circ g$ → $f(g(x))$ → "inner function $g$ pehle." > [!mistake] Mistake 2: Domain Restrictions Ignore Karna > **Galat soch:** "Agar $f(x) = \sqrt{x}$ aur $g(x) = x-5$ ho, toh $(f \circ g)(x) = \sqrt{x-5}$ sabhi $x \geq 0$ ke liye kaam karta hai." > > **Yeh sahi kyun lagta hai:** Hum $\sqrt{\cdots}$ dekhte hain aur sochte hain "domain non-negative hai," bhool jaate hain ki $-5$ cheezein shift kar deta hai. > > **Sach:** $(f \circ g)(x)$ ke liye $g(x) \geq 0$ chahiye, yaani $x - 5 \geq 0$, isliye $x \geq 5$. Domain $[5, \infty)$ hai, $[0, \infty)$ nahi. > > **Mistake ko samjho:** Agar $g$ identity hoti $g(x) = x$, toh domain $[0, \infty)$ hota. Yeh mistake $g$ ko transparent maanti hai, yeh bhool kar ki yeh pehle input transform karta hai. > > **Fix kaise karein:** Hamesha trace karo: "$g$ kya output deta hai? Kya $f$ us output ko handle kar sakta hai?" Intermediate value ke liye inequality set up karo. > [!mistake] Mistake 3: Composition Ko Multiplication Ki Tarah Treat Karna > **Galat soch:** "Composition addition par distribute hoti hai: $(f \circ (g+h))(x) = (f \circ g)(x) + (f \circ h)(x)$." > **Yeh sahi kyun lagta hai:** Multiplication addition par distribute hoti hai: $a(b+c) = ab + ac$. Composition ek circle use karti hai jaise multiplication $\times$ use karta hai. > > **Sach:** Composition distribute NAHI hoti. Definition se: > $(f \circ (g+h))(x) = f((g+h)(x)) = f(g(x) + h(x))$ > Yeh $f(g(x)) + f(h(x))$ ke equal NAHI hai jab tak $f$ linear na ho. > **Mistake ko samjho:** Agar $f$ linear ho (jaise $f(x) = 3x$), toh $f(g(x) + h(x)) = 3(g(x)+h(x)) = 3g(x) + 3h(x) = f(g(x)) + f(h(x))$, aur distribution kaam karta hai. Yeh mistake is special case ko overgeneralize karti hai. > > **Fix kaise karein:** Yaad rakho composition function **application** hai, algebraic multiplication nahi. Ek nonlinear example jaise $f(x) = x^2$ se verify karo. --- ## Active Recall Drills > [!recall]- Feynman Explanation (Ek 12-saal ke bachche ko samjhao) > Socho tumhare paas do magic boxes hain. Pehla box (function $g$) jo bhi number daalo use kuch aur bana deta hai—shayad double kar deta hai. Doosra box (function $f$) ek number leta hai aur usme 5 add karta hai. > > **Function composition** in boxes ko ek line mein rakhne jaisi hai. Tum apna number pehle box ($g$) mein daalo, jo nikle use pakdo, phir turant WOHI number doosre box ($f$) mein daalo. Jo final answer milta hai woh "composed" function $f \circ g$ hai. > Yahan trick hai: **ORDER matter karta hai**! Agar double-phir-5-add karo, alag answer milega, aur agar 5-add-phir-double karo, toh alag. Jaise cake bake karna: pehle eggs daalna phir mix karna, pehle mix karna phir eggs daalne se alag hai. Boxes sahi order mein hone chahiye, aur hum unhe right-to-left padhte hain (sabse right wala box tumhare number par pehle operate karta hai). > > Jab hum $f(g(x))$ likhte hain, hum keh rahe hain "$x$ ko pehle $g$ mein daalo, phir $g$ ka answer $f$ mein daalo." Composition bas itna hi hai—numbers ke liye ek fancy assembly line! > [!mnemonic] Memory Aid > **"Read Right, Act Right"** > - $f \circ g$ ke liye, **right** se padho: $g$ pehle act karta hai > - Socho: **"fog"** = "f of g" = "f ko g ka output milta hai" > - Visualize karo: $x \xrightarrow{g} g(x) \xrightarrow{f} f(g(x))$ (arrow flow left jaata hai) > > **Domain Mnemonic:** "Can Only Go if Gears Fit" > - $g$ ke output **gears**, $f$ ke input **gears** mein fit hone chahiye > - Range of $g$ ⊆ Domain of $f$ --- ## Connections - [[Functions - definition and notation]]: Composition basic function evaluation par build hoti hai - [[Domain and range of function]]: Yeh determine karne ke liye critical hai ki composition kab defined hai - [[Inverse functions]]: $(f \circ f^{-1})(x) = x$ aur $(f^{-1} \circ f)(x) = x$ (identity) - [[Bijective functions]]: Sirf bijections ke inverses hote hain jinhe aap identity par compose kar sako - [[Derivatives - chain rule]]: $\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)$ composition ka derivative hai - [[Function transformations]]: Graphs shift/scale karna composition use karta hai: $f(x+2)$, $f \circ g$ hai jahan $g(x)=x+2$ - [[Exponential and logarithmic functions]]: $\log(\exp(x)) = x$ inverses ke saath composition hai --- #flashcards/maths $(f \circ g)(x)$ ka matlab kya hai? :: Pehle $g$ apply karo, phir us result par $f$ apply karo: $f(g(x))$. Right-to-left padho. Kya function composition commutative hai? Ek example do. ::: Nahi. Generally $f \circ g \neq g \circ f$. Example: agar $f(x)=2x$ aur $g(x)=x+3$, toh $f(g(x))=2x+6$ lekin $g(f(x))=2x+3$. Kya function composition associative hai? :: Haan. $(h \circ g) \circ f = h \circ (g \circ f)$. Dono $h(g(f(x)))$ ke barabar hain. Composition ke liye identity function property kya hai? ::: $f \circ I = I \circ f = f$, jahan $I(x) = x$. Identity ke saath compose karne se $f$ unchanged rehta hai. $(f \circ g)(x)$ ka domain kaise dhundho? ::: (1) $g$ ke domain se shuru karo. (2) Ensure karo ki $g$ ke output values $f$ ke domain mein aayein. Domain woh saare $x$ hain jo $g$ ke domain mein hain aur jahan $g(x)$, $f$ ke domain mein ho. Agar $f(x) = x^2$ aur $g(x) = x+1$ ho, toh $(f \circ g)(x)$ kya hai? ::: $(f \circ g)(x) = f(g(x)) = f(x+1) = (x+1)^2 = x^2 + 2x + 1$. Agar $f(x) = \sqrt{x}$ aur $g(x) = x-9$ ho, toh $(f \circ g)(x)$ ka domain kya hai? ::: $(f \circ g)(x) = \sqrt{x-9}$. $x-9 \geq 0$ chahiye, isliye domain $[9, \infty)$ hai. $h(x) = (3x-2)^5$ diya ho, $f \circ g$ mein decompose karo. ::: Maano $g(x) = 3x-2$ (inner) aur $f(x) = x^5$ (outer). Toh $(f \circ g)(x) = (3x-2)^5 = h(x)$. Composition addition par distribute kyun nahi hoti? ::: $f((g+h)(x)) = f(g(x)+h(x))$ generally $f(g(x)) + f(h(x))$ ke barabar NAHI hota. Function application multiplication nahi hai. Sirf tab kaam karta hai jab $f$ linear ho. $(h \circ g \circ f)(x)$ mein kaun sa function pehle act karta hai? ::: $f$ pehle act karta hai (sabse right mein), phir $g$, phir $h$. $h(g(f(x)))$ ki tarah evaluate karo. ## 🖼️ Concept Map ```mermaid flowchart TD C[Function Composition] C -->|models as| A[Assembly Line Idea] C -->|defined as| D["(g∘f)(x) = g(f(x))"] D -->|requires| DR[Range of f in Domain of g] C -->|notation reads| RTL[Right-to-Left Chain] D -->|computed by| M[Inner First, Then Outer] M -->|step 1| S1[Evaluate f(x)] S1 -->|step 2| S2[Substitute into g] D -->|implies| P1[Non-Commutative] P1 -->|shown by| EX["f∘g ≠ g∘f"] D -->|implies| P2[Associative] P2 -->|both give| H["h(g(f(x)))"] ```