# Formulas for computing composite function

## Homework Statement:

Let f and g be two functions defined as follows:

$f(x) = \frac{x+|x|}{2}$

$g(x) = \begin{cases} x \text{ for x < 0} \\ x^2 \text{ for x ≥ 0} \end{cases}$

Find a formula, or formulas, for computing the composite function h(x) = f[g(x)]

## Relevant Equations:

f ο g = f[g(x)]
h(x) = 0 for x ≤ 0
h(x) = x^2 for x>0

But my book says

h(x) = 0 for x<0
h(x) = x^2 for x≥0

Can my solution (the first one) work as well? Because the actual function value at x = 0 is zero. I feel like my solution is more elegant.

Related Calculus and Beyond Homework Help News on Phys.org
anuttarasammyak
Gold Member
Yes, the both give the same result.

• rxh140630
PeroK
Homework Helper
Gold Member
h(x) = 0 for x ≤ 0
h(x) = x^2 for x>0

But my book says

h(x) = 0 for x<0
h(x) = x^2 for x≥0
These define the same function ##h##. To see this, you can ask at what points do the function values differ?

• rxh140630
These define the same function ##h##. To see this, you can ask at what points do the function values differ?
They do not differ because x^2 at x=0 = 0, if we choose to use the authors definition.

Since they do not differ then they must be the same.

Last edited: