Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My friend has given me a math problem to solve just for fun. I have never seen these types of functions before but I undrestand what composition means.

If $f(x)=\left\{ \begin{array}{ll} 1+x, & \hbox{when }x<0 \\ 2 & \hbox{when }x>0 \end{array} \right.$ and $g(x)=\left\{ \begin{array}{ll} -1, & \hbox{when }x<1; \\ x, & \hbox{when }x\geq 1 \end{array} \right.$

How would I go about finding the formula of $g\circ f$ (composition of $g$ and $f$)?

share|cite|improve this question
It's hard to tell that you're talking about piece wise functions since some of the line breaks are lost in formatting. I would edit, but I'm on iOS... :) – The Chaz 2.0 Mar 14 '12 at 6:47
What is $f(0)$? – anon Mar 14 '12 at 6:55

Determining $g\circ f\;$ reduces to characterizing when $f(x)\ge1$ or $f(x)<1$. Obviously $2\ge1$ so for any positive $x>0$ (where $f(x)=2$) we have $g(f(x))=f(x)=2$. Otherwise, when $x<0$, $f(x)=1+x$ is less than $1$ so $g(f(x))=-1$. You haven't prescribed what $f(0)$ is so I omit that for now.

$$(g\circ f)(x)=\begin{cases}2 & x>0 \\ -1 & x<0. \end{cases} $$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.