# Want to amplify the difference between two functions without changing the shape of the functions themselves.

I have two functions, we will call them $$f(x)$$ and $$g(x)$$. $$f(x) = 72017699250\sin(5x/6) - 8009034768.5\sin(x)$$ $$g(x) = 949075059240 \sin(x/3) - 733177811520 \sin(x/6) \\+ 288902934936 \sin(2 x/3) - 669516586200 \sin(x/2)$$ Over the interval $$-9, these functions are almost exactly identical with the difference between them being about $$10^{-10}$$ at most.

However, there is actually an interesting structure where the functions are not quite equal for the most part but have several intersections where they cross each other. This structure results in the function: $$F(x) ≡ [f(x) - g(x)]$$ having "superoscillations" over this interval.

I would like to be able to actually see the difference in the functions and the intersection points clearly in order to be able to demonstrate how these shapes give rise to the "superoscillations" but the difference between them is far too small.

The idea I had was to somehow find a way to "amplify" the difference between the functions without altering the shape of the functions themselves. So use $$f(x)$$ as a baseline, then at every point define a new function that is identical to $$g(x)$$ in every respect, except for whatever the difference $$[g(x) - f(x)]$$ is for a given $$g(s)$$, amplify that difference by multiplying the difference, not the function itself, by some constant $$c$$.

So any region of $$g(x)$$ that is below the graph of $$f(x)$$ will move downward because the difference is negative, and any region of $$g(x)$$ that is above $$f(x)$$ will move upward because the difference is positive. And the points where $$g(x)$$ and $$f(x)$$ intersect will remain unchanged because the difference is zero. But otherwise, preserving the shape of the graph of $$g(x)$$ perfectly.

Is there some manipulation I can do to the function to accomplish this? I feel that there must be but I can't for the life of me figure out what that might be.

The graphs of the functions can be seen here: https://www.desmos.com/calculator/j3idygs5gq

Thanks!

• To type mathematics, please use \$... \$. Commented Aug 23, 2021 at 1:56

It sounds like you want a function $$h$$ such that $$h(x)-f(x)=C(g(x)-f(x))$$, where $$C>1$$ is your "amplification" constant. So use $$h(x)=f(x)+C(g(x)-f(x))$$.
This can be written as $$h(x)=Cg(x)+(1-C)f(x)$$, which is just a weighted average of $$f$$ and $$g$$. As you vary $$C$$ from $$0$$ to $$1$$, $$h$$ morphs from $$f$$ into $$g$$. By taking $$C>1$$, you're extrapolating this morphing to continue away from $$f$$ beyond $$g$$.
• Hmm, I'm not sure what you mean by preserving the shape of $g$. Amplifying its difference with $f$ is a change to its shape.