How to find the x coordinate of the maximum of |f(x)|

53 Views Asked by At

I have the following function:

$$ f(x) = {\sin{x}\over a + \cos{x}} $$

I have found that this function has a maximum $$ f_\mathrm{max} = \arctan{\left(1\over\sqrt{a^2 - 1}\right)}$$ at $x = \arccos{\left(-{1\over a}\right)}$.

However, I am considering now the function:

$$ g(x) = |f(x) + b| $$

And I am trying to find the maximum value of $g(x)$ and its corresponding $x$ value.

Using the graph of the function, I can see that:

$$ g_\mathrm{max} = f_\mathrm{max} + |b| $$

But this time, the $x$ coordinate of the $g_\mathrm{max}$ will depend on the sign of $b$. That is:

  • if $b \geq 0$ then $g_\mathrm{max}$ occurs at: $x = \arccos{\left(-{1\over a}\right)}$
  • if $b < 0$ then $g_\mathrm{max}$ occurs at $x = 2\pi - \arccos{\left(-{1\over a}\right)}$

My question:

Is it possible to express the last two conditions into a single formula? in other words, is there a single formula for $x$ coordinate of $g_\mathrm{max}$ ?

Your help is very much appreciated