I have a test and need some desperate help on functions

In summary, functions are blocks of code that perform a specific task and are useful for organizing complex programs. They can take in inputs, process them, and return an output when called or invoked. To define a function, use the keyword "function" followed by the function name and a set of parentheses. To call a function, use its name followed by parentheses, passing in any necessary arguments. Functions can also return a value using the "return" keyword. They can be used to solve problems by breaking them down into smaller tasks and calling the functions in a specific order. This makes the code more organized and easier to debug.
  • #1
nando94
33
0
I got a test and I am having trouble on functions. On the quiz we had this problem on composite functions.

given f(x) = 6/(3-x) and g(x) = 5/3x find the following

a. f of g

b. the domain of f of g

c. the range of f of g


My attempts

a. For a I got 6/3 - 5/3x = 18x/9x - 5 which was the right answer. No problems here. However I am stuck on b and c.

b.For b I got (-infinity, 0) (0, 5/9) (5/9, 3) (3,infinity). My teacher marked the 3's as wrong
and I don't know why. What I did was found the domain of f and g sperately and then excluded them from f of g. So I am kind of confused.

c. Right answer was (-infinity,0) (0,2) (2,infinity) For the range I kind of forgot how to find the range! But I found the inverse of f of g and then used the domain of the inverse since that's the range which was (-infinity,2)(2,infinity). Then I realized that since these were rational functions it was the horizontal asymptote but I am not sure if that's the right reason.

I really need help with this!
 
Last edited:
Physics news on Phys.org
  • #2
nando94 said:
a. For a I got 6/3 - 5/3x = 18x/9x - 5 which was the right answer. No problems here. However I am stuck on b and c.
Oh, really? What you wrote is
[itex]\frac{6}{3} - \frac{5}{3x} = \frac{18x}{9x} - 5[/itex]
... and that's not the answer. (In other words, PLEASE use parentheses!)

nando94 said:
b.For b I got (-infinity, 0) (0, 5/9) (5/9, 3) (3,infinity). My teacher marked the 3's as wrong
and I don't know why. What I did was found the domain of f and g sperately and then excluded them from f of g. So I am kind of confused.
The domain of g (the inner function) is (-∞, 0) U (0, ∞). The range is the same. The domain of f (the outer function), however, is (-∞, 3) U (3, ∞). The domain of f(g(x)) consists of all x-values in the domain of g that map to g(x)-values in the domain of f.

The problem here is that the range of g includes one value, 3, that cannot be in the domain of f. So you need the x-value so that g(x) = 3, and remove it from the domain of g. So solving
[itex]\frac{5}{3x}=3[/itex]
gives you x = 5/9, and so the domain of f(g(x)) is
(-∞, 0) U (0, 5/9) U (5/9, ∞).

nando94 said:
c. Right answer was (-infinity,0) (0,2) (2,infinity) For the range I kind of forgot how to find the range! But I found the inverse of f of g and then used the domain of the inverse since that's the range which was (-infinity,2)(2,infinity). Then I realized that since these were rational functions it was the horizontal asymptote but I am not sure if that's the right reason.
Now that we removed x = 5/9 from the domain of g, its range now becomes
(-∞, 0) U (0, 3) U (3, ∞). But since the domain of f was (-∞, 3) U (3, ∞) (which included 0), we have to now find what f(0) is and remove it from the range of f.
[itex]f(0) = \frac{6}{3-0} = 2[/itex]
Since the range of f was (-∞, 0) U (0, ∞), the range of f(g(x)) now becomes
(-∞, 0) U (0, 2) U (2, ∞).

If you think this was all confusing, you'd be right. I've just taught this to my precalculus students and most of them had trouble understanding it all. :cry:
 
Last edited:
  • #3
Thanks I see it now. You don't include the 3 because your finding f(g(x)). So you have to find g(3) instead. So if if you had to do g(f(x)) then you would find f(0) instead right?
 
  • #4
nando94 said:
Thanks I see it now. You don't include the 3 because your finding f(g(x)). So you have to find g(3) instead.
Not quite. I said that you have to find x-values such that g(x) = 3. It's not the same thing as finding g(3).

nando94 said:
So if if you had to do g(f(x)) then you would find f(0) instead right?
Again, not quite. Finding the domain of g(f(x)) is easier in this problem.
The range of f (now the inner function) is (-∞, 0) U (0, ∞).
The domain of g (now the outer function) is also (-∞, 0) U (0, ∞).
All values in the range of f are in the domain of g, so we don't have to "pull values out" of the domain of f.
So the domain of g(f(x)), in this case, is the same as the domain of f(x): (-∞, 3) U (3, ∞).
And since nothing was changed in the domain of g(f(x)), the range of g(f(x)) is the same as the range of g(x): (-∞, 0) U (0, ∞).
 

1. What are functions and how do they work?

Functions are blocks of code that perform a specific task. They are useful for organizing complex programs and making them more manageable. They can take in inputs, process them, and return an output. Functions are executed when they are called or invoked.

2. How can I define a function in my code?

To define a function, you use the keyword "function" followed by the name of the function and a set of parentheses. Inside the parentheses, you can specify any parameters that the function will take in. After the parentheses, you use curly braces to enclose the code that makes up the function.

3. How do I call or invoke a function?

To call a function, you simply use its name followed by a set of parentheses. If the function has parameters, you pass in the corresponding arguments inside the parentheses. The function will then execute and return an output, if any.

4. Can functions return a value?

Yes, functions can return a value. This is done using the keyword "return" followed by the value that the function will return. If no return statement is included, the function will return undefined by default.

5. How can I use functions to solve a problem?

Functions can be used to solve a problem by breaking it down into smaller, more manageable tasks. Each task can be written as a separate function, and then all the functions can be called in a specific order to solve the problem. This makes the code more organized and easier to debug.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
3
Views
580
  • Precalculus Mathematics Homework Help
Replies
15
Views
596
  • Precalculus Mathematics Homework Help
Replies
10
Views
820
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
22
Views
895
  • Precalculus Mathematics Homework Help
Replies
23
Views
568
  • Precalculus Mathematics Homework Help
Replies
10
Views
578
  • Precalculus Mathematics Homework Help
Replies
11
Views
481
  • Precalculus Mathematics Homework Help
Replies
7
Views
358
  • Precalculus Mathematics Homework Help
Replies
3
Views
864
Back
Top