Chapterبەش 5 · Lectureوانە 5.4
Composition of Functionsئاوێتەکردنی نەخشەکان
Machine after machine: , its domain with two checks, why , the trap where hides its domain, finding an inside function, the homework with answers, composition in Python, and an overview of the whole course with what comes next.
ئامێر لە دوای ئامێر: ، بە دوو پشکنین، بۆچی ، ئەو تەڵەیەی کە دەشارێتەوە، دۆزینەوەی ، ئەرکی ماڵەوە لەگەڵ وەڵامەکان، لە Pythonـدا و کورتەیەکی هەموو کۆرسەکە لەگەڵ هەنگاوی داهاتوو.
What you will learnچی فێر دەبیت
- Compute and read it as "g first, then f".
- Find the domain of with two checks, even when the simplified formula hides it.
- Show with an example that , and split a function into an inside and an outside function.
- Find an inside function g from f and .
- بژمێرە و وەک «یەکەم g، پاشان f» بیخوێنەرەوە.
- بە دوو پشکنین بدۆزەرەوە، تەنانەت کاتێک فۆرمولە سادەکراوەکە دەیشارێتەوە.
- بە نموونەیەک پیشان بدە کە و بۆ و دابەش بکە.
- g لە f و ـەوە بدۆزەرەوە.
Machine after machineئامێر لە دوای ئامێر
A function is like a machine: a number goes in, a number comes out. Put two machines in a row and the output of the first becomes the input of the second. This is .
نەخشە وەک ئامێرێکە: ژمارەیەک دەچێتە ژوورەوە و ژمارەیەک دێتە دەرەوە. دوو ئامێر لە دوای یەک دابنێ، یەکەم دەبێتە دووەم. ئەمە .
A taxi example. A taxi in the city drives at 30 km/h, so after t minutes it has gone km. The fare for d km is dinars. The fare after t minutes comes from the two machines one after the other:
نموونەی تەکسی. تەکسییەک لە شاردا بە خێرایی 30 km/h دەڕوات، بۆیە دوای t خولەک km ڕۆیشتووە. کرێی d km دینارە. کرێی دوای t خولەک لە دوو ئامێرەکەوە یەک لە دوای یەک دێت:
So a 20-minute ride costs 7000 dinars.
کەواتە گەشتێکی 20 خولەکی 7000 دینار دەکات.
In a bakery the dough machine works first and the oven second: flour → dough → bread. Swap the order and you bake flour, which makes no bread. Composition is the same: the order of the machines matters.
لە نانەواخانەدا ئامێری هەویر یەکەم کار دەکات و تەنوور دووەم: ئارد دەبێتە هەویر و هەویر دەبێتە نان. ڕیزبەندییەکە بگۆڕە، ئارد دەبرژێنیت و نان دروست نابێت. هەمان شتە: ڕیزبەندیی ئامێرەکان گرنگە.
Where the analogy stops workingسنووری ئەم نموونەیە
A real oven takes almost anything; a maths machine accepts only inputs from its domain. That second check is where composition gets tricky.
تەنووری ڕاستەقینە نزیکەی هەموو شتێک وەردەگرێت؛ ئامێری بیرکاری تەنها لە وەردەگرێت. ئەو پشکنینە دووەمە شوێنی ئاڵۆزیی .
Definition and notationپێناسە و نووسین
The notes define: if f and g are functions, the composite function is
تێبینییەکان پێناسە دەکەن: ئەگەر f و g بن، بریتییە لە
Read "f of g of x" or "f after g". The function written closest to x works first: here g, then f.
دەخوێنرێتەوە «f لە دوای g». ئەو لە x نزیکترە یەکەم کار دەکات: لێرەدا g، پاشان f.
Example: ("square it") and ("add 3"). Then , and .
نموونە: («دووجای بکە») و («3 زیاد بکە»). ئەو کاتە و .
The order matters: ڕیزبەندی گرنگە:
Swap the machines and the result usually changes. With and :
ئامێرەکان بگۆڕەوە، ئەنجامەکە زۆرجار دەگۆڕێت. بە و :
| Orderڕیزبەندی | Formulaفۆرمولە | At لە ـدا |
|---|---|---|
| : add 3, then square: 3 زیاد بکە، پاشان دووجای بکە | ||
| : square, then add 3: دووجای بکە، پاشان 3 زیاد بکە | ||
| : multiply the outputs: لێک بدە |
So in general . There are special pairs that give the same result in both orders: a function and its inverse undo each other, so and are both the Identity function (each on its own domain).
بۆیە بە گشتی . جووتی تایبەت هەن کە بە هەردوو ڕیزبەندی هەمان ئەنجام دەدەن: و پێچەوانەی نەخشەکەی کاری یەکتر هەڵدەوەشێننەوە، بۆیە و هەردووکیان نەخشەی هەرئەوێتیی ـن (هەر یەکەیان لەسەر خۆی).
The domain of : two checksبواری : دوو پشکنین
An input x survives the composition only if it passes both machines. The notes write:
x تەنها کاتێک لە دەردەچێت کە بە هەردوو ئامێرەکەدا تێبپەڕێت. تێبینییەکان دەنووسن:
Both checks must pass. Check 1: g must accept x. Check 2: f must accept the number .
هەردوو پشکنینەکە دەبێت سەربکەون. پشکنینی 1: g دەبێت x وەربگرێت. پشکنینی 2: f دەبێت ژمارەی وەربگرێت.
Watch it with (accepts every x) and (accepts only ). For , g gives and f cannot take a square root of it:
بە (هەموو xێک وەردەگرێت) و (تەنها وەردەگرێت) سەیری بکە. بۆ ، g دەدات و f ناتوانێت ئەو ژمارەیە بدۆزێتەوە:
![Animation with two machines: g(x) = 1 − x squared, then f(u) = square root of u. Inputs pass one at a time. x = 0 gives 1, then 1 (accepted). x = 0.6 gives 0.64, then 0.8 (accepted). x = −1 gives 0, then 0 (accepted). x = 2 gives −3, and machine f turns orange and rejects it, because the square root of −3 is not real. x = 1.5 gives −1.25 and is rejected too. A number line below collects green dots for accepted inputs and orange crosses for rejected ones. The last frame shades the interval from −1 to 1: the domain of f ∘ g is [−1, 1].](/_astro/calc-composition-machines.en.5O4ehpVN.gif)
![Animation with two machines: g(x) = 1 − x squared, then f(u) = square root of u. Inputs pass one at a time. x = 0 gives 1, then 1 (accepted). x = 0.6 gives 0.64, then 0.8 (accepted). x = −1 gives 0, then 0 (accepted). x = 2 gives −3, and machine f turns orange and rejects it, because the square root of −3 is not real. x = 1.5 gives −1.25 and is rejected too. A number line below collects green dots for accepted inputs and orange crosses for rejected ones. The last frame shades the interval from −1 to 1: the domain of f ∘ g is [−1, 1].](/_astro/calc-composition-machines.ckb.DaDLX977.gif)
Algebra gives the same answer: we need , that is , so .
جەبریش هەمان وەڵام دەدات: پێویستمان بە ـە، واتە ، بۆیە .
In Kurdish: composing two functions and finding the domain of the composite function, from the Grade 12 book.
بە کوردی: و دۆزینەوەی ، لە کتێبی پۆلی 12.
Sorani, Grade 12 science (3-1) composition of functions (ئاوێتەکردنی نەخشەکان) and the domain of a composite function.
بە سۆرانی، پۆلی 12ـی زانستی (3-1): و .
Worked example: , نموونەی چارەسەرکراو: ،
The example in the notes asks for , and , with no answers. Here are the answers and, just as important, their domains. Start with (we need ) and .
نموونەکەی تێبینییەکان داوای ، و دەکات، بێ وەڵام. ئەمانە وەڵامەکانن لەگەڵ ، کە بە هەمان ئەندازە گرنگن. بە (پێویستمان بە ـە) و دەست پێبکە.
Put into f. Since for every x, check 2 always passes, so the domain is . Remember that (see absolute value):
بخە ناو f. لەبەر ئەوەی بۆ هەموو xێک ، پشکنینی 2 هەمیشە سەردەکەوێت، بۆیە ـە. لەبیرت بێت (بڕوانە نرخی ڕووت):
Now f works first, so check 1 needs , that is :
ئێستا f یەکەم کار دەکات، بۆیە پشکنینی 1 پێویستی بە هەیە، واتە :
Check 1: . Check 2: the inner result must be in , so , which means , :
پشکنینی 1: . پشکنینی 2: ئەنجامی ناوەوەی دەبێت لە ـدا بێت، بۆیە ، واتە ، :
Check with numbers: , and . But does not exist: .
بە ژمارە بپشکنە: ، و . بەڵام بوونی نییە: .
Finding the inside functionدۆزینەوەی نەخشەی ناوەوە
Homework from the notes: find such that , where .
ئەرکی ماڵەوە لە تێبینییەکانەوە: بدۆزەرەوە بە جۆرێک کە ، کە .
- Write what f does to بنووسە f چی بە دەکات
f doubles its input and adds 1, so .
f دووهێندە دەکات و 1 زیاد دەکات، بۆیە .
- Set it equal and solve for یەکسانی بکە و بۆ چارەسەری بکە
Undo the two steps of f in reverse order: subtract 1, then halve.
دوو هەنگاوەکەی f بە ڕیزبەندیی پێچەوانە هەڵبوەشێنەوە: 1 لێ دەربکە، پاشان نیوەی بکە.
- Checkپشکنین
. For example and .
. بۆ نموونە و .
Going the other way is also useful: splitting a complicated function into an inside and an outside part. is with the inside and the outside ; for example .
ڕێگای پێچەوانەش بەسوودە: دابەشکردنی ئاڵۆز بۆ بەشێکی ناوەوە و بەشێکی دەرەوە. دەکاتە بە ناوەوەی و دەرەوەی ؛ بۆ نموونە .
Homework: , ئەرکی ماڵەوە: ،
The notes ask for four compositions and their domains. Here and . Try each one before you open the answer.
تێبینییەکان داوای چوار و دەکەن. لێرەدا و . هەر یەکێکیان تاقی بکەرەوە پێش ئەوەی وەڵامەکە بکەیتەوە.
Find and its domain.
و بدۆزەرەوە.
Show answerوەڵامەکە پیشان بدە
Check 2 needs , so . This is the composition of the animation above; its graph is the upper half of the circle of radius 1.
پشکنینی 2 پێویستی بە هەیە، بۆیە . ئەمە هەمان نموونەی جووڵەپێدانەکەی سەرەوەیە؛ هێڵکارییەکەی نیوەی سەرەوەی بازنەیەکە بە نیوەتیرەی 1.
Find and its domain.
و بدۆزەرەوە.
Show answerوەڵامەکە پیشان بدە
The same trap as before: looks defined everywhere, but f must accept x first, so .
هەمان تەڵەی پێشوو: وا دەردەکەوێت لە هەموو شوێنێک پێناسەکراو بێت، بەڵام f دەبێت یەکەم x وەربگرێت، بۆیە .
Find and its domain.
و بدۆزەرەوە.
Show answerوەڵامەکە پیشان بدە
Check 1 needs ; then always passes check 2.
پشکنینی 1 پێویستی بە هەیە؛ پاشان هەمیشە لە پشکنینی 2 دەردەچێت.
Find and its domain.
و بدۆزەرەوە.
Show answerوەڵامەکە پیشان بدە
g accepts every real number, so nothing is removed. Note that is not .
g هەموو وەردەگرێت، بۆیە هیچ شتێک لاناچێت. تێبینی بکە کە هەمان نییە.
Composition in codeئاوێتەکردنی نەخشەکان لە کۆددا
Programs compose functions all the time: f(g(x)) calls g first and passes its return value to f. The domain trap shows up as an error when the inner result is not allowed in the outer function:
بەرنامەکان هەمیشە ئاوێتە دەکەن: f(g(x)) یەکەم g بانگ دەکات و دەدات بە f. تەڵەی وەک دەردەکەوێت کاتێک ئەنجامی ناوەوە لە دەرەوەدا ڕێگەپێدراو نییە:
import math
def g(x):
return 1 - x**2
def f(x):
return math.sqrt(x)
for x in [0, 0.6, -1, 2]:
print(x, "->", g(x), "->", f(g(x)))0 -> 1 -> 1.0 0.6 -> 0.64 -> 0.8 -1 -> 0 -> 0.0 Traceback (most recent call last): ... ValueError: math domain error
Python 3.12 and 3.13 print this message. Python 3.14 and newer word it differently: ValueError: expected a nonnegative input, got -3.0.
Python 3.12 و 3.13 ئەم پەیامە چاپ دەکەن. Python 3.14 و نوێتر بە شێوەیەکی تر دەینووسن: ValueError: expected a nonnegative input, got -3.0.
Explain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 10
f(g(x)): the inner call runs first, exactly like .f(g(x)): بانگکردنی ناوەوە یەکەم کار دەکات، ڕێک وەک .- Lineدێڕی 7
For ,
g(2)is andmath.sqrt(-3)raisesValueError: 2 is not in .بۆ ،
g(2)دەکاتە وmath.sqrt(-3)ValueErrorدەدات: 2 لە ـدا نییە.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | Correctڕاست |
|---|---|
| Applying f first in جێبەجێکردنی f لە پێشدا لە | The function next to x works first: g, then f.ئەو لە تەنیشت xـەوەیە یەکەم کار دەکات: g، پاشان f. |
| Reading as multiplicationخوێندنەوەی وەک لێکدان | , but .، بەڵام . |
| Assuming وا دانان کە | Check with a number: .بە ژمارەیەک بپشکنە: . |
| Reading the domain from the simplified formula ()خوێندنەوەی لە فۆرمولە سادەکراوەکەوە () | Use both checks on the original functions: .هەردوو پشکنینەکە لەسەر ڕەسەنەکان بەکاربهێنە: . |
| Using only for تەنها بەکارهێنانی بۆ | x must be in and in .x دەبێت لە ـدا بێت و لە ـدا. |
| Writing نووسینی | ; for it is , not x.؛ بۆ دەکاتە ، نەک x. |
Summaryکورتە
- : g works first, f second ("f after g").
- : two checks, one per machine.
- In general , and is not multiplication.
- Find the domain before simplifying: only for .
- To find an inside function, undo the outside function step by step: .
- : g یەکەم کار دەکات، f دووەم («f لە دوای g»).
- : دوو پشکنین، بۆ هەر ئامێرێک یەکێک.
- بە گشتی و لێکدان نییە.
- پێش سادەکردن بدۆزەرەوە: تەنها بۆ .
- بۆ دۆزینەوەی ، هەنگاو بە هەنگاو هەڵبوەشێنەوە: .
, : is equal to ?، : ئایا یەکسانە بە ؟
No: but .
نەخێر: بەڵام .
What is for and ?بۆ و ، چییە؟
All real x except 2, because is not in .
هەموو xێکی ڕاستی جگە لە 2، چونکە لە ـدا نییە.
The course so far and what comes nextکۆرسەکە تا ئێرە و هەنگاوی داهاتوو
This is the last lesson on functions. Here is what chapters 1–5 built, and where the course goes next:
ئەمە دوایین وانەیە دەربارەی . ئەمە ئەوەیە کە بەشەکانی 1–5 بنیاتیان نا، هەروەها کۆرسەکە دواتر بەرەو کوێ دەچێت:
- Sets and numbers: sets, and , and the number families .
- Inequalities and absolute value: the rules of order, intervals, sign charts and as a distance.
- Functions and their graphs: domain and range, kinds of functions, one-to-one and onto, and the basic graphs.
- Trigonometric, exponential and logarithmic functions: sine and its family, inverse functions, , e and .
- Transforming and combining functions: shifts, stretches and reflections, , , and .
- Next — Matrices and determinants: tables of numbers, how to add and multiply them, and the .
- کۆمەڵەکان و ژمارەکان: ، و ، هەروەها خێزانەکانی ژمارە .
- لاسەنگەکان و نرخی ڕووت: یاساکانی ڕیزبەندی، ، و وەک دووری.
- نەخشەکان و هێڵکارییەکانیان: و ، جۆرەکانی ، یەک بۆ یەک و گشتگر و هێڵکارییە بنەڕەتییەکان.
- نەخشە سێگۆشەییەکان، نەخشە توانییەکان و لۆگاریتمەکان: و خێزانەکەی، ، ، e و .
- گۆڕانکارییەکان و تێکەڵکردنی نەخشەکان: ، و ، ، ، و .
- دواتر — ماتریکسەکان و دیتەرمینانتەکان: خشتەی ژمارەکان، چۆنیەتی کۆکردنەوە و لێکدانیان، و .
What comes next. The next chapter, Matrices and determinants, opens a new tool: tables of numbers that store data, move points in and solve many equations at once. Later in calculus, the next ideas are (what value approaches as x gets close to a number) and (how fast a function changes). Both are built from exactly what chapters 1–5 taught: intervals and absolute value to say "close to", domains to know where a function lives, and composition, exponentials and logarithms as the functions you will study.
هەنگاوی داهاتوو. بەشی داهاتوو، ماتریکسەکان و دیتەرمینانتەکان، ئامرازێکی نوێ دەکاتەوە: خشتەی ژمارە کە هەڵدەگرن، خاڵەکان لە دەجووڵێنن و چەندین پێکەوە شیکار دەکەن. دواتر لە کالکولەسدا بیرۆکەکانی دواتر ن ( لە چ بەهایەک نزیک دەبێتەوە کاتێک x لە ژمارەیەک نزیک دەبێتەوە) و ( بە چ خێراییەک دەگۆڕێت). هەردووکیان ڕێک لەوە بنیات دەنرێن کە بەشەکانی 1–5 فێری کردیت: و بۆ گوتنی «نزیک لە»، بۆ زانینی ئەوەی لە کوێ دەژی، هەروەها ، و ، کە دواتر وەک نموونە لێیان دەکۆڵیتەوە.
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
What f(g(x)) means: put g's output into f. Numerical and algebraic examples, with both notations f(g(x)) and (f∘g)(x).
واتای چییە: g بخەرە ناو f. نموونەی ژمارەیی و جەبری، بە هەردوو نووسینی و .
Chapters: 0:00 introduction, 0:43 and 2:00 numerical examples, 2:42 and 4:25 algebraic composition.
بەشەکان: 0:00 پێشەکی، 0:43 و 2:00 نموونەی ژمارەیی، 2:42 و 4:25 بە .
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Matrix Notation and Special Matricesنووسینی ماتریکس و جۆرە تایبەتەکانی
Related lecturesوانە پەیوەندیدارەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.