Suppose I need to solve for the argmax of $x$ for an integral that can be factored as follows:
$$ A = \mathrm{argmax}_x \int_Y f(x,y)g(y)dy $$
Where both $f()$ and $g()$ are strictly positive, and the form of $f(x,y)$ is sufficiently horrible that I can't solve the integral directly. However, what is easy to solve is this different integral
$$ \int_Y \log{\left[f(x,y)\right]}g(y)dy $$
Since $x$ only appears in the $f()$ function, and the integrand is factored like so, it seems to me that the argmax of the second integral is equal to the argmax of the first integral, because the logarithm is continuous and strictly increasing. So, am I allowed to do:
$$ A = \mathrm{argmax}_x \int_Y \log{\left[f(x,y)\right]}g(y)dy $$
?
I think I can, but I want to double check to see if there are any subtleties to this.
(If it helps to give stronger conditions / motivate what I'm trying to do: $f()$ and $g()$ are both probability density functions, and I need to marginalize over $y$ and get the MLE for $x$. Assume that the functions are continuous and otherwise obey enough regularity conditions for all of this to make sense).