Function Composition Calculator
Enter two linear functions and a point x to compute f(g(x)).
Result
How it is calculated
The tool composes two straight-line functions, f(x) = a1x + b1 and g(x) = a2x + b2. Composition applies g first, then f: g(x) = a2x + b2 and (f∘g)(x) = a1 × g(x) + b1. Expanded, the composite is again a line with slope a1a2 and intercept a1b2 + b1. All five fields are required and any real number is accepted, including zero and negatives, as long as every result stays below about 9 × 1015 in size; larger values show no result. Results are rounded to two decimals. The order matters: (g∘f)(x) is a different function, with intercept a2b1 + b2, so swap the two functions to get it. If a1 is 0, f is constant and the composite has slope 0.
Worked example
Let f(x) = 2x + 3, g(x) = -1x + 4 and x = 5. First g: -1 × 5 + 4 = -1, so g(5) is -1.00. Then f: 2 × (-1) + 3 = 1. Composite slope: 2 × (-1) = -2. Composite intercept: 2 × 4 + 3 = 11. Result: 1.00 for (f∘g)(5), with composite slope -2.00 and intercept 11.00. Check: -2 × 5 + 11 = 1.
Common mistakes
- Applying the functions in the wrong order. (f∘g)(x) puts x into g first and the result into f; swapping them gives intercept 1 instead of 11 for this example.
- Entering the intercept with the wrong sign. For g(x) = 4 − x, the slope is -1 and the intercept is 4, not the other way round.
- Leaving a field blank when the function has no x term. A constant function such as f(x) = 7 needs a1 = 0 and b1 = 7; with a blank field there is no result.
- Multiplying the two functions instead of composing them. f(x) × g(x) is a quadratic, whereas composition gives a straight line with slope a1a2.
- Expecting nonlinear functions to work. Only functions of the form ax + b are supported, so f(x) = x² cannot be entered.
About this calculator
Function composition (f∘g)(x) means feeding the output of one function directly into another: first compute g(x), then plug that result into f. For two linear functions f(x) = a₁x + b₁ and g(x) = a₂x + b₂, the composite works out to (f∘g)(x) = a₁(a₂x + b₂) + b₁ = (a₁a₂)x + (a₁b₂ + b₁), which is itself a linear function with slope a₁a₂ and intercept a₁b₂ + b₁.
Composition is a core idea in algebra and precalculus courses because it generalizes far beyond lines — the chain rule in calculus is essentially the derivative version of composing functions, and chaining together simple transformations (like scaling, then shifting, then scaling again) to build a more complex one is a technique used throughout math, computer graphics, and signal processing.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Be the first to comment.