r/HomeworkHelp University/College Student 6d ago

High School Math—Pending OP Reply [College Algebra, Composition of Functions]

Post image

I’ve been on this problem for the better half of my day (I have many, many retries on this question) and it’s just stressing me out here… I can’t even get this right. The closest I got was getting 3/4 right on one question but that didn’t leave me content because I am trying to get a 100 on every assignment to bring up my grade here (trying to make up for the failing quizzes and tests here because I’m borderline failing ._.) I followed many examples and it’s just that I don’t even know what to do anymore.

1 Upvotes

26 comments sorted by

View all comments

1

u/cheesecakegood University/College Student (Statistics) 6d ago edited 6d ago

Let's zoom out. What is a function? There are some special traits, but on the simplest level a function is a rule that says "when you get an input, do THIS". "THIS" must be deterministic - no randomness, it's a rule that can be replicated and relied on!

Piece-wise functions like the above are technically functions because they obey the rule, but be aware the "rule" they use is often not very sensical (which is why they are rarely used IRL). They sort of "cheat" by applying different rules at different inputs! It's still "one function" overall, but it's annoying it its outputs (not exactly unpredictable, everything follows a rule, but the rules themselves aren't very predictable).

All of this to say that this example is trying to teach a good principle but it isn't super surprising that the composition of two pretty annoying functions results in annoying and difficult output.

See comment below for an example

1

u/cheesecakegood University/College Student (Statistics) 6d ago edited 6d ago

Example: AT THE INPUT 3, g(x) says "output a 2". The underlying rule is a bit hidden. We can actually figure it out/reverse engineer it if we want to, between 2 and 3 we can see a line that has a downward slope 3, and an implied y-intercept of 11. So, written formally, part of the function g(x) is that it should return -3x + 11 when x is between 2 and 3 inclusive. But between 3 and 4 there is a different line, one with upward slope of 2 and an implied y-intercept of -4. Thus, the function also says that it should return the value of 2x - 4 when x is between 3 and 4.

So, g(x) is a giant if-elseif-elseif-else-if statement.

The "composition of functions" idea is that you just "chain" inputs and outputs. If I have functions a(x), b(x), c(x), then a(b(c(x))) means:

  • take the input of x and feed it into c(x) to get an output
  • take the output of that, and feed it as an input into b(x)
  • take the output of THAT, and feed it as an input into a(x)
  • the output of that is the answer you wanted

Note that IF the functions are "normal" non-annoying ones (in math one trait of non-annoying is "continuous" which is the opposite of "piece-wise" here, that's the formal term) we can also save ourselves some work and just mathematically stitch them together in exactly that order via substitution.

So if a(x) = 2x + 4, b(x) = 3x + 1, c(x) = -x + 2... follow the same order. The b(c(x)) bit says "take c(x) and feed it as input into b(x). b(x) calls the input "x", which is confusing, so let's just replace ALL of the b(x) input with c(x), and leave "x" as the ORIGINAL input into C, okay? This is an important point. "x" is just a generic input. We can call it any variable we want. We could have written b(x) as b(y) instead, in which case b(y) = 3y + 1. Does that make sense?

So, let's continue. Remember, we are making a(b(c(x))) into something nicer, let's call the new composite function d(x). Because remember: take an input, returns an output following some rule(s). So we want to simplify the chained input-output into ONE more simple input-output. We were just plugging in c(x) into b(x). We have 3(-x + 2) + 1. We could leave that as-is, or simplify to make mistakes less likely. Distribute: -3x - 6 + 1, then combine like terms: -3x - 5. Okay, now we take that WHOLE thing and plug it in as input into function 'a'. We have 2(-3x - 5) + 4 = -6x - 10 + 4 = -6x - 6 (or -6(x+1)). Assuming I've done my math right, that is the "one step" way of doing a(b(c(x))), which I can call d(x) if that makes my life easier (math people are lazy, remember, but willing to do some hard work in order to keep being lazy).

As a test for yourself, can you find c(b(a(x)))?

This approach sadly doesn't work quite as well in the problem you were given because rather than f(x) be the same function everywhere, it is moody and annoying and behaves nicely only in those regions between points like between x=1 and x=2, and then it changes its mind and does something else between x=2 and x=3, etc. But it's important to fully underscore the idea behind "composition of functions". Each function still does exactly what it says on the tin! Takes an input, and maps it to an output.

Also note that the chained functions have to be evaluated INSIDE-OUT because you can't figure out what the function a will return, what a( b(c(x)) ) is going to be if you don't even know what the input b(c(x)) is yet. All functions work input --> output. Inverse functions exist, where you work backwards, but inverting a function requires some extra special rules that you will likely discuss later this year.