1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Piece wise function

  1. Apr 23, 2010 #1
    1. The problem statement, all variables and given/known data

    Given that f(R)=R , g(R)=R be defined respectively by

    [tex]f(x)=\begin{cases} \sin x+2 & \text{if } x>1 \\ \cos x-2 & \text{if } x\leq 1\end{cases}[/tex]

    [tex]g(x)=\begin{cases}2x+3& \text{if } x>0 \\ x^2 & \text{if } x\leq 0 \end{cases} [/tex]

    Find f o g and g o f

    2. Relevant equations

    3. The attempt at a solution

    i have no idea to begin except for the obvious substitution of g(x) into the function f(x) . I am not sure how to adjust the domain .
  2. jcsd
  3. Apr 23, 2010 #2


    User Avatar
    Homework Helper

    For x>1, wouldn't f(x) = sinx +2 and g(x)=2x +3 ?
  4. Apr 23, 2010 #3


    User Avatar
    Science Advisor

    You need to be careful of the domains. If [itex]x\le 0[/itex], [itex]g(x)= x^2[/itex] but then [itex]x^2< 1[/itex] if x> -1 and [itex]x^2> 1[/itex] if x< -1.

    If x> 0, [itex]g(x)= 2x+ 3[/itex] and, since x is positive, that is always larger than 3 which is larger than 1.

    You need to divide into three intervals: for x<-1, [itex]g(x)= x^2> 1[/itex] so [itex]f(g(x))= f(x^2)= sin(x^2)+ 2[/itex]. for [itex]-1\le x\le 0[/itex], [itex]g(x)= x^2\le 1[/itex] so [itex]f(g(x))= f(x^2)= cos(x^2)- 1[/itex]. For x> 0, g(x)= 2x+ 3 and f(g(x))= f(2x+3)= sin(2x+3)+ 2.

    Now, you do g(f(x))
  5. Apr 23, 2010 #4
    thanks !
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook