[Moved - S.Khan] Composition of piecewise function

JayQuery

New member
Joined
Feb 11, 2016
Messages
2
Hello,

i'm in need of some help with a task involving the composition of two piecewise functions. The task is:

Solve the composition f o g if f(x) and g(x) are real-valued functions

{ x+1 ; x < -2​
f(x) = { -x-2 ; -2 <= x < 0
{ x+2 ; x >= 0​


g(x) = { x2 ; x >= 0
{ 1 ; x < 0

The solution is supposed to be:

(f o g)(x) = { x2+2 ; x >= 0​
{ 3 ; x < 0​


Now i know the basics about the composition of two functions, for example, if you have f(x) = x+1 and g(x) = x+2 , the composition (f o g)(x) = f(g(x)) = x+2+1 = x+3.
The problem i have here is, i don't know which part of f(x) and g(x) to work with. I know that it's got something to do with the domain (or at least i'm guessing), but i'm not sure what. I tried the following, since it seemed logical to me: (i looked at every domain of the f(x) function and calculated the composition)

1. x < -2

f(x) = x+1
g(x) = 1

(f o g)(x) = 1+1 = 2


2. -2 <= x < 0

f(x) = -x-2
g(x) = 1

(f o g)(x) = -1-2 = -3


3. x >= 0

f(x) = x+2
g(x) = x2

(f o g)(x) = x2+2

The only part i got right was the third part, i'm assuming that is because the domain of f(x) and g(x) were exactly the same, whereas in the first two cases, the domains were not exactly the same.

I would be very grateful, if someone could explain the principle behind this task.
Thank you in advance.

Also, i apologize if i posted this in the wrong section.
 
Last edited:
Solve the composition f o g if f(x) and g(x) are real-valued functions​
{ x+1 ; x < -2
f(x) ={ -x-2 ; -2 <= x < 0
{ x+2 ; x >= 0

g(x) = { x2 ; x >= 0
{ 1 ; x < 0

The solution is supposed to be:
(f o g)(x) = { x2+2 ; x >= 0
{ 3 ; x < 0​
Also, i apologize if i posted this in the wrong section. YES it is probably in the wrong forum.
Let's make it readable.
\(\displaystyle {f(x)=\begin{cases}x+1 &\: x<-2\\-x-2 &\:-2\le x<0\\x+2 &\: x\ge 0\end{cases}}\)
\(\displaystyle {g(x)=\begin{cases}x^2 &\: x\ge 0\\1 &\: x<0\end{cases}}\)

All you have to do is start with \(\displaystyle g(x)\)
\(\displaystyle {f\circ g(x)=\begin{cases}x^2+2 &\: x\ge 0\\3 &\: x<0\end{cases}}\)
 
I am sorry, but i don't quite understand what you mean by start with g(x). Can you please explain a bit more?
 
Hello,

i'm in need of some help with a task involving the composition of two piecewise functions. The task is:

Solve the composition f o g if f(x) and g(x) are real-valued functions

{ x+1 ; x < -2​
f(x) = { -x-2 ; -2 <= x < 0
{ x+2 ; x >= 0​


g(x) = { x2 ; x >= 0
{ 1 ; x < 0

The solution is supposed to be:

(f o g)(x) = { x2+2 ; x >= 0​
{ 3 ; x < 0​


Now i know the basics about the composition of two functions, for example, if you have f(x) = x+1 and g(x) = x+2 , the composition (f o g)(x) = f(g(x)) = x+2+1 = x+3.
The problem i have here is, i don't know which part of f(x) and g(x) to work with. I know that it's got something to do with the domain (or at least i'm guessing), but i'm not sure what. I tried the following, since it seemed logical to me: (i looked at every domain of the f(x) function and calculated the composition)

1. x < -2

f(x) = x+1
g(x) = 1

(f o g)(x) = 1+1 = 2


2. -2 <= x < 0

f(x) = -x-2
g(x) = 1

(f o g)(x) = -1-2 = -3


3. x >= 0

f(x) = x+2
g(x) = x2

(f o g)(x) = x2+2

The only part i got right was the third part, i'm assuming that is because the domain of f(x) and g(x) were exactly the same, whereas in the first two cases, the domains were not exactly the same.

I would be very grateful, if someone could explain the principle behind this task.
Thank you in advance.

Also, i apologize if i posted this in the wrong section.
Let's look at your case 1: if x < -2 then g(x) = 1. Well 1>=0 so f(1)=?

Continue in that manner.
 
There are only two cases: \(\displaystyle x\ge 0~\&~x<0 \).
For f(x) there are only two cases but what about g(x). For the composite function we have
\(\displaystyle {f\circ g(x)=\begin{cases}g(x)+1 &\: g(x)<-2\\-g(x)-2 &\:-2\le g(x)<0\\g(x)+2 &\: g(x)\ge 0\end{cases}}\)
Now suppose g(x)=-1. How many cases are there for f(g(x)) = \(\displaystyle f\circ g(x)\)? Looks like just one to me
f(g(x)) = -3, \(\displaystyle -\infty\, \le\, x\, \le\, \infty\).

However, with the given problem, I do agree that it eventually breaks down to the two cases you mentioned.
 
For f(x) there are only two cases but what about g(x). For the composite function we have
\(\displaystyle {f\circ g(x)=\begin{cases}g(x)+1 &\: g(x)<-2\\-g(x)-2 &\:-2\le g(x)<0\\g(x)+2 &\: g(x)\ge 0\end{cases}}\)
Now suppose g(x)=-1. How many cases are there for f(g(x)) = \(\displaystyle f\circ g(x)\)? Looks like just one to me
f(g(x)) = -3, \(\displaystyle -\infty\, \le\, x\, \le\, \infty\).

However, with the given problem, I do agree that it eventually breaks down to the two cases you mentioned.
Are you kidding us? Why in the world are you replying to a question that you clearly do not understand?"You posted " f(x) there are only two cases" when it clearly has three cases. The function \(\displaystyle g \) has only two cases.
It is always the case that the \(\displaystyle Dom(H\circ J) \) is \(\displaystyle Dom(J) \) !
So in this case \(\displaystyle Dom(f\circ g) \) is \(\displaystyle Dom(g) \) where there are just two cases: \(\displaystyle x\ge 0\text{ or }x<0 \).

Please do study this distinction.
The correct answer is
\(\displaystyle {f\circ g(x)=\begin{cases}x^2+2 &\: x\ge 0\\3 &\: x<0\end{cases}}\)

If you do not get that, you need to review basics before answering.
 
Are you kidding us? Why in the world are you replying to a question that you clearly do not understand?"You posted " f(x) there are only two cases" when it clearly has three cases. The function \(\displaystyle g \) has only two cases.
It is always the case that the \(\displaystyle Dom(H\circ J) \) is \(\displaystyle Dom(J) \) !
So in this case \(\displaystyle Dom(f\circ g) \) is \(\displaystyle Dom(g) \) where there are just two cases: \(\displaystyle x\ge 0\text{ or }x<0 \).

Please do study this distinction.
The correct answer is
\(\displaystyle {f\circ g(x)=\begin{cases}x^2+2 &\: x\ge 0\\3 &\: x<0\end{cases}}\)

If you do not get that, you need to review basics before answering.

You are correct in that I did mistakenly write that f(x) had only two cases. But if I don't understand the problem could you, in all you wisdom, please elucidate on my mistake in what I wrote in the following:
\(\displaystyle {f\circ g(x)=\begin{cases}g(x)+1 &\: g(x)<-2\\-g(x)-2 &\:-2\le g(x)<0\\g(x)+2 &\: g(x)\ge 0\end{cases}}\)
when it is given that
\(\displaystyle {f(x)=\begin{cases}x+1 &\: x<-2\\-x-2 &\:-2\le x<0\\x+2 &\: x\ge 0\end{cases}}\)

EDIT: Oh, and just for grins and giggles, what would have been the answer if
\(\displaystyle {g(x)=\begin{cases}-x^2 &\: x\ge 0\\1 &\: x<0\end{cases}}\)
Still, just a \(\displaystyle x\ge0\, and\, x\lt\, 0\) partition for \(\displaystyle f\circ g\)?
 
Last edited:
But if I don't understand the problem could you, in all you wisdom, please elucidate on my mistake in what I wrote in the following:
\(\displaystyle {f(x)=\begin{cases}x+1 &\: x<-2\\-x-2 &\:-2\le x<0\\ \Large \color{blue}x+2 &\: x\ge 0 \end{cases}}\)
\(\displaystyle {g(x)=\begin{cases}x^2 &\: x\ge 0\\1 &\: x<0\end{cases}}\)

Note that \(\displaystyle \forall x,~g(x)\ge 0\) thus the only case in \(\displaystyle f\) that we use is the third line.
 
But if I don't understand the problem could you, in all you wisdom, please elucidate on my mistake in what I wrote in the following:
\(\displaystyle {f(x)=\begin{cases}x+1 &\: x<-2\\-x-2 &\:-2\le x<0\\ \Large \color{blue}x+2 &\: x\ge 0 \end{cases}}\)
\(\displaystyle {g(x)=\begin{cases}x^2 &\: x\ge 0\\1 &\: x<0\end{cases}}\)

Note that \(\displaystyle \forall x,~g(x)\ge 0\) thus the only case in \(\displaystyle f\) that we use is the third line.
Do you always just quote what you wish of what you are pretending to answer when you choose to answer a question which has no bearing on the question asked? The full question I asked in response to your post
Are you kidding us? Why in the world are you replying to a question that you clearly do not understand?"...
was
You are correct in that I did mistakenly write that f(x) had only two cases. But if I don't understand the problem could you, in all you wisdom, please elucidate on my mistake in what I wrote in the following:
\(\displaystyle {f\circ g(x)=\begin{cases}g(x)+1 &\: g(x)<-2\\-g(x)-2 &\:-2\le g(x)<0\\g(x)+2 &\: g(x)\ge 0\end{cases}}\)
when it is given that
\(\displaystyle {f(x)=\begin{cases}x+1 &\: x<-2\\-x-2 &\:-2\le x<0\\x+2 &\: x\ge 0\end{cases}}\)

EDIT: Oh, and just for grins and giggles, what would have been the answer if
\(\displaystyle {g(x)=\begin{cases}-x^2 &\: x\ge 0\\1 &\: x<0\end{cases}}\)
Still, just a \(\displaystyle x\ge0\, and\, x\lt\, 0\) partition for \(\displaystyle f\circ g\)?

So, just in case you didn't understand the first time the actual question I asked which you pretended to answer in your statements above is what is incorrect in the following
\(\displaystyle {f\circ g(x)=\begin{cases}g(x)+1 &\: g(x)<-2\\-g(x)-2 &\:-2\le g(x)<0\\g(x)+2 &\: g(x)\ge 0\end{cases}}\)
when it is given that
\(\displaystyle {f(x)=\begin{cases}x+1 &\: x<-2\\-x-2 &\:-2\le x<0\\x+2 &\: x\ge 0\end{cases}}\)
You know, it does occur to me that you might be saying that if someone posts these two equations, then they clearly don't understand the original question posted by the OP. If that is the case, then although you are certainly entitled to your opinion, I wouldn't, if I were you, advertise your opinion to try to show your authority as someone what actually knows everything about the problem as posed.

Oh, and I see you ignored the EDIT also. Well, maybe what one should expect from you.
 
Top