Defining the range and domain of Composite functions as well as plotting graphs of composite functions

256 Views Asked by At

Consider a function $$f(x)=\vert{\vert {x-3} \vert -2}\vert$$ for $0\le x\le 4$

And $$g(x)= 4-\vert {2-x}\vert$$ for $-1\le x\le 3$

Where $\vert .\vert$ represents modulus function.

Now the problem is that I want to draw the graph of $f(g(x))$.

Now I could make cases by the finding the critical points of the modulus functions and then plot the graph. But this seems to be a very tedious task. I want to know if there is any other way to plot the graph of such composite functions without taking so much of cases. Any help would be greatly appreciated.

$\mathbf {Edit :} $

CY Aries' method seems to be very appropriate for this question but what if the question asks for some cubic or quadratic function. e. g. $$f(x) = \begin{cases} 1+x^3, & \text{$x\le 0$} \\ x^2-1, & \text{$x\ge 0$} \end{cases}$$

and

$$g(x) = \begin{cases} (x-1)^{\frac{1}{3}}, & \text{$x\le 0$} \\ (x+1)^{\frac{1}{2}}, & \text{$x\ge 0$} \end{cases}$$

Then plot $g(f(x))$. Now that method won't work here. I am also supposed to define the non-uniform function $g(f(x))$

3

There are 3 best solutions below

0
On BEST ANSWER

(i) The graph of $y=2-x$

enter image description here

(ii) Taking the modulus function means flipping everything below the $x$-axis to the upper half-plane. The graph of $y=|2-x|$

enter image description here

(iii) The graph of $y=-|2-x|$

enter image description here

(iv) The graph of $y=g(x)=-|2-x|+4$

enter image description here

(v) The graph of $y=g(x)-3$

enter image description here

(vi) The graph of $y=|g(x)-3|$

enter image description here

(vii) The graph of $y=|g(x)-3|-2$

enter image description here

(viii) The graph of $f(g(x))=||g(x)-3|-2|$

enter image description here

If the domain is the set of all real numbers, the graph will be

enter image description here

0
On

My method is before dividing the real line into intervals, find the critical points first. What are the critical points of $f(x)$? These are $|x-3|=0,2$, i.e., $x=1,3,5$.

Now for $f(g(x))$ these critical points correspond to $g(x)=4-|2-x|=1,3,5$. Since $5$ can be excluded because $g(x)\leq 4$, the critical points are $|x-2|=0,1,3$, which are $x=-1,1,2,3,5$.

Now you can graph the function $f(g(x))$, which is piecewise linear, by joining the dots $(x,f(g(x)))$ for these critical points.

1
On

Since graphing is generally done by computer, here's the simple solution in Mathematica:

f[x_] := Abs[Abs[x - 3] - 2];
g[x_] := 4 - Abs[2 - x];
Plot[f[g[x]], {x, -4, 8}]

f[g[x]]