# Composition of a piecewise function and another function

I have this two functions. $f(x)=\arcsin \left(\dfrac{3-x}{3x-1} \right)$ and $g(x)=\begin{cases} 0 ;& |x| <\pi \\ \sin(2x);& |x| \ge \pi \end{cases}.$

I have to find $f \circ g$.

I found out that $f$ has the following property; $$f:(-\infty,-1] \cup [1,\infty) \to \left[-\frac{\pi}{2},-\arcsin\left(\frac{1}{3}\right)\right) \bigcup \left(-\arcsin\left(\frac{1}{3}\right),\frac{\pi}{2}\right]$$ and $$g: \mathbb{R} \to [-1,1]$$ Now I don't know how to compute the composition. I know that $f \circ g = f(g(x)).$

• What's troubling you exactly? Is it the domain of $f\circ g$ or the actual expression? Jun 16, 2016 at 20:32
• Its the $f \circ g$ expression. I don't know what to substitute in $f.$ I know that the domain of $g$ is $\mathbb{R}$ so should I just get $f(x)=\arcsin (\frac{3-\sin(2x)}{3 \sin(2x)-1}) ?$ Jun 16, 2016 at 20:38
• The domain of $f\circ g$ isn't $\mathbb R$, I don't think. Usually function composition is defined is one these two ways. 1. Given $\varphi\colon A\to B$ and $\psi\colon B\to C$, then $\psi\circ \varphi$ is a function from $A\to C$ defined by $\psi(\varphi(a))$, for all $a\in A$. (Note that the range of $\varphi$ is contained in $B$ which is the domain of $\psi$, this is important). 2. Given $\varphi\colon A\to B$ and $\psi\colon X\to Y$, then $\psi\circ \varphi$ is a function from $\left\{a\in A\colon \varphi(a)\in X\right\}\to Y$ defined by $\psi(\varphi(a))$, for all $a$ in the given set. Jun 16, 2016 at 20:53

You can compose two functions iff the value mapped by the first function are included into the domain of the second function. In this case the only values mapped by g which are included into the domain of f are +1,-1.

The preimage of 1 by g is ${\{x = \pi/4 + k\pi \text{ where } k \text{ is an integer and } k \ne -1\} \\}$.

The preimage of -1 by g is ${\{x = -\pi/4 + k\pi \text{ where } k \text{ is an integer and } k \ne 1 \} \\}$.

Moreover 1 is mapped by f into $\pi/2$ and -1 is mapped by f into $-\pi/2$.

Thus

${ f\circ g : \begin{array}{1} \pi/4 + n\pi \rightarrow \pi/2 \text{ for every n integer and } n \ne -1 \\ -\pi/4 + m\pi \rightarrow -\pi/2 \text{ for every m integer and } m \ne -1 \\ \end{array} }$

Hint:

If

$$g(x)=\begin{cases} 0& |x| <\pi \\ \sin(2x)& |x| \ge \pi \end{cases}$$

then

$$f(g(x))=\begin{cases} \arcsin \left(\dfrac{3-0}{3\cdot0-1} \right) & |x| <\pi \\ \arcsin \left(\dfrac{3-\sin(2x)}{3\sin(2x)-1} \right)& |x| \ge \pi. \end{cases}$$

Remains to find the domain, which is that of $g$ minus the values for which the argument of the $\arcsin$ doesn't work.

• What's $(f\circ g)(0)$? Jun 16, 2016 at 20:44
• @GitGud: as $|0|<\pi$, this is simply $\arcsin(-3)$, which is not defined. Hence $0$ is out of the domain.
– user65203
Jun 16, 2016 at 20:46
• The way you wrote it implies $0$ is in the domain, because $|0|<\pi$. Jun 16, 2016 at 20:47
• @No, because the function value associated to that case isn't defined. This is perfectly valid. When you write $f(x)=\sqrt x$, this doesn't imply that $-1$ is in the domain. $\sqrt{-1}$ isn't defined, hence neither $f(-1)$.
– user65203
Jun 16, 2016 at 20:49
• Hm? Of course it doesn't. Your notation is just another way of writing "$f(g(x))=\arcsin(-3)$ if $|x|<\pi$". Writing this implies well-definiteness of $\arcsin(-3)$. You can't write an equality unless both sides of $=$ are meaningful entities. Jun 16, 2016 at 20:56