Subtracting functions on specified domains

1. Nov 28, 2014

2thumbsGuy

2. Nov 28, 2014

pwsnafu

I need clarification. Do you mean f(x) is defined on more than [b,c], or f has domain [b,c]

3. Nov 28, 2014

2thumbsGuy

both f(x) and g(x) have values outside of the defined domains, but I want to only consider the values within their respective defined domains.

I'll be using this in some software, so maybe it's best that I constrain the domains within the software instead of in the math, but I wanted to get all possible approaches before committing to a single answer.

4. Nov 28, 2014

pwsnafu

Okay that part is easy.
Define new functions F and G where
$F(x) = f(x)$ if $x \in [b,c]$ and $F(x) = 0$ elsewhere.
Do the same with G.

Second question: do we know $[b,c] \subset [a,d]$?

5. Nov 28, 2014

2thumbsGuy

Thank you very much! This is familiar.

To your second question, the domains will vary according to circumstance. For this case we can use a = 1, b = 2, c = 3, d = 4. But they will change many, many times.

6. Nov 28, 2014

2thumbsGuy

Actually, I think the programming solution would be the same as the math solution. As you say, f(x) if x∈[b,c] and F(x)=0 elsewhere, and the same for g(x). This is normal if/then scenario.

I know how I can do this! Thanks for helping me think through it.